Opened 12 months ago

Closed 9 months ago

#67395 closed defect (fixed)

cpuid @1.8.2: build fails on Tiger and Leopard

Reported by: Cebtenzzre Owned by: Cebtenzzre
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: tiger leopard Cc: RJVB (René Bertin)
Port: cpuid

Description

I cannot install the cpuid port on Tiger 10.4.8 i386 with Xcode 2.5 or Leopard 10.5.8 i386 with Xcode 3.1.4. The build fails with this error:

:info:build /usr/bin/gcc-4.2 -I/opt/local/include -Os -arch i386 -I. -fno-strict-aliasing -std=gnu89 -Wall -Wextra -Wdeclaration-after-statement -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wno-overlength-strings -Wold-style-definition -Wstrict-prototypes  -fPIC -arch x86_64 -MD -c -o cache.o cache.c
:info:build gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
:info:build make: *** [cache.o] Error 1

Patching -arch x86_64 out of the Makefile does not work because gcc 4.2 cannot compile cpuid.c anyway:

gcc-4.2 -I/opt/local/include -Os -arch i386 -I. -fno-strict-aliasing -std=gnu89 -Wall -Wextra -Wdeclaration-after-statement -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wno-overlength-strings -Wold-style-definition -Wstrict-prototypes  -fPIC -MD -c -o cpuid.o cpuid.c
cpuid.c: In function 'cpuid_native':
cpuid.c:153: error: can't find a register in class 'BREG' while reloading 'asm'
cpuid.c:153: error: 'asm' operand has impossible constraints

The build works fine with gcc-mp-7 or clang-mp-3.4.

Attachments (1)

main.log (12.1 KB) - added by Cebtenzzre 12 months ago.
Log of failed build on Leopard

Download all attachments as: .zip

Change History (5)

Changed 12 months ago by Cebtenzzre

Attachment: main.log added

Log of failed build on Leopard

comment:1 Changed 12 months ago by Cebtenzzre

I was able to get it to build by blacklisting a few compilers:

compiler.blacklist-append gcc-3.3 *gcc-4.0 *gcc-4.2

And making sure the destroot step uses the same compiler, to avoid a failure from * rebuilding cpuid: new build flags or prefix:

destroot.args-append CC=${configure.cc} LD=${configure.cc}

comment:2 Changed 12 months ago by RJVB (René Bertin)

Thanks for figuring this out. Can you attach a patch file please, then hopefully someone with commit permissions will apply it.

comment:4 Changed 9 months ago by Cebtenzzre

Owner: set to Cebtenzzre
Resolution: fixed
Status: newclosed

In b2a04cc09a7ebc902c48b2eedb2016416960afe0/macports-ports (master):

cpuid: blacklist old gcc, fixes build on macOS <10.6

gcc <=4.2 doesn't support the options used in the Makefile, or the 'asm'
statement used for the cpuid instruction.

Fixes: #67395

Note: See TracTickets for help on using tickets.