#66630 closed defect (fixed)

cpufetch tries to build x86 on 10.6.8 Rosetta

Reported by: barracuda156 Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: powerpc, rosetta, snowleopard Cc:
Port: cpufetch

Description

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cpufetch/cpufetch/work/compwrap/cc/usr/bin/gcc-4.2 -Os -arch ppc -Wall -Wextra -pedantic -DARCH_X86 -std=c99 -fstack-protector-all -O2 -Wfloat-equal -Wshadow -Wpointer-arith src/common/main.c src/common/cpu.c src/common/udev.c src/common/printer.c src/common/args.c src/common/global.c src/x86/cpuid.c src/x86/apic.c src/x86/cpuid_asm.c src/x86/uarch.c -o cpufetch
src/common/printer.c: In function ‘longest_attribute_length’:
src/common/printer.c:403: warning: declaration of ‘max’ shadows a global declaration
src/common/../common/global.h:14: warning: shadowed declaration is here
src/common/printer.c: In function ‘longest_field_length’:
src/common/printer.c:417: warning: declaration of ‘max’ shadows a global declaration
src/common/../common/global.h:14: warning: shadowed declaration is here
src/common/printer.c: In function ‘print_cpufetch’:
src/common/printer.c:938: warning: declaration of ‘show_full_cpu_name’ shadows a global declaration
src/common/args.h:46: warning: shadowed declaration is here
src/x86/cpuid.c: In function ‘get_peak_performance’:
src/x86/cpuid.c:182: warning: declaration of ‘accurate_pp’ shadows a global declaration
src/x86/../common/args.h:45: warning: shadowed declaration is here
src/x86/cpuid.c: In function ‘set_cpu_module’:
src/x86/cpuid.c:368: warning: implicit declaration of function ‘bind_to_cpu’
src/x86/apic.c: In function ‘bit_scan_reverse’:
src/x86/apic.c:29: warning: declaration of ‘index’ shadows a global declaration
/usr/include/string.h:125: warning: shadowed declaration is here
src/x86/apic.c: In function ‘get_total_cores_module’:
src/x86/apic.c:115: error: ‘cpu_set_t’ undeclared (first use in this function)
src/x86/apic.c:115: error: (Each undeclared identifier is reported only once
src/x86/apic.c:115: error: for each function it appears in.)
src/x86/apic.c:115: error: expected ‘;’ before ‘original_mask’
src/x86/apic.c:116: warning: implicit declaration of function ‘sched_getaffinity’
src/x86/apic.c:116: error: ‘original_mask’ undeclared (first use in this function)
src/x86/apic.c:122: warning: implicit declaration of function ‘bind_to_cpu’
src/x86/apic.c:149: warning: implicit declaration of function ‘sched_setaffinity’
src/x86/apic.c: In function ‘max_apic_id_size’:
src/x86/apic.c:250: warning: declaration of ‘max’ shadows a global declaration
src/x86/../common/global.h:14: warning: shadowed declaration is here
src/x86/apic.c: In function ‘fill_apic_ids’:
src/x86/apic.c:353: warning: unused parameter ‘first_core’
src/x86/cpuid_asm.c: In function ‘cpuid’:
src/x86/cpuid_asm.c:4: error: impossible constraint in ‘asm’
make: *** [cpufetch] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cpufetch/cpufetch/work/Dr-Noob-cpufetch-49941b1'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cpufetch/cpufetch/work/cpufetch-1.03" && /usr/bin/make -j8 -w all CC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cpufetch/cpufetch/work/compwrap/cc/usr/bin/gcc-4.2" CXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cpufetch/cpufetch/work/compwrap/cxx/usr/bin/g++-4.2" OBJC="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cpufetch/cpufetch/work/compwrap/objc/usr/bin/gcc-4.2" OBJCXX="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_cpufetch/cpufetch/work/compwrap/objcxx/usr/bin/g++-4.2" INSTALL="/usr/bin/install -c" 
Exit code: 2
Error: Failed to build cpufetch: command execution failed

Change History (6)

comment:1 Changed 23 months ago by barracuda156

Then once that is fixed (and correct arch is being built), it fails with:

cc1: error: unrecognized command line option "-Wno-language-extension-token"
make: *** [cpufetch] Error 1

comment:2 Changed 23 months ago by barracuda156

Then, once unsupported flag is patched out, if fails on:

src/common/printer.c:487: error: ‘ATTRIBUTE_CPU_NUM’ undeclared (first use in this function)
src/common/printer.c:487: error: (Each undeclared identifier is reported only once
src/common/printer.c:487: error: for each function it appears in.)
src/common/printer.c: In function ‘print_cpufetch_ppc’:
src/common/printer.c:693: error: too few arguments to function ‘print_ascii_generic’
src/common/printer.c: In function ‘print_cpufetch’:
src/common/printer.c:938: warning: declaration of ‘show_full_cpu_name’ shadows a global declaration
src/common/args.h:46: warning: shadowed declaration is here
src/ppc/uarch.c:6:22: error: sys/auxv.h: No such file or directory
make: *** [cpufetch] Error 1

comment:3 Changed 23 months ago by barracuda156

So this is genuinely broken: gcc12 also fails to build it:

src/common/printer.c: In function 'print_ascii_generic':
src/common/printer.c:487:23: error: 'ATTRIBUTE_CPU_NUM' undeclared (first use in this function); did you mean 'ATTRIBUTE_PEAK'?
  487 |       if(attr_type == ATTRIBUTE_CPU_NUM) {
      |                       ^~~~~~~~~~~~~~~~~
      |                       ATTRIBUTE_PEAK
src/common/printer.c:487:23: note: each undeclared identifier is reported only once for each function it appears in
src/common/printer.c: In function 'print_cpufetch_ppc':
src/common/printer.c:693:3: error: too few arguments to function 'print_ascii_generic'
  693 |   print_ascii_generic(art, longest_attribute, term->w, attribute_fields);
      |   ^~~~~~~~~~~~~~~~~~~
src/common/printer.c:433:6: note: declared here
  433 | void print_ascii_generic(struct ascii* art, uint32_t la, int32_t termw, const char** attribute_fields, bool hybrid_architecture) {
      |      ^~~~~~~~~~~~~~~~~~~
src/ppc/uarch.c:6:10: fatal error: sys/auxv.h: No such file or directory
    6 | #include <sys/auxv.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [cpufetch] Error 1

comment:4 Changed 23 months ago by kencu (Ken)

no log available, so nobody can realistically help you

Last edited 23 months ago by kencu (Ken) (previous) (diff)

comment:5 in reply to:  4 Changed 23 months ago by barracuda156

Replying to kencu:

no log available, so nobody can realistically help you

PPC fix is there: https://github.com/macports/macports-ports/pull/17225

But take a look, it is actually broken for Intel now across the board: https://ports.macports.org/port/cpufetch/details https://github.com/Dr-Noob/cpufetch/issues/168

comment:6 Changed 23 months ago by Marius Schamschula <mschamschula@…>

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.