Open garoffoli opened 3 months ago
It is not specific to 10.4. Using uname -m
is wrong, it does not return arch family, what should be used is uname -p
.
make: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_sysutils_cpufetch/cpufetch/work/cpufetch-1.05'
Makefile:51: Unsupported arch detected: Power Macintosh. See https://github.com/Dr-Noob/cpufetch#1-support
Makefile:52: If your architecture is supported but the compilation fails, please open an issue in https://github.com/Dr-Noob/cpufetch/issues
Makefile:53: *** Aborting compilation. Stop.
I.e.,
36-231% uname -m
Power Macintosh
36-231% uname -p
powerpc
You could easily compile it by replacing the following line in the Makefile:
arch := $(shell uname -m)
with
arch := ppc
But it is pointless, since the code itself has to be fixed: it does not work as is:
(gdb) run
Starting program: /opt/local/bin/cpufetch
Reading symbols for shared libraries ++. done
Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0x00008060 in get_cpu_info ()
It is not specific to 10.4. Using
uname -m
is wrong, it does not return arch family, what should be used isuname -p
.make: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_sysutils_cpufetch/cpufetch/work/cpufetch-1.05' Makefile:51: Unsupported arch detected: Power Macintosh. See https://github.com/Dr-Noob/cpufetch#1-support Makefile:52: If your architecture is supported but the compilation fails, please open an issue in https://github.com/Dr-Noob/cpufetch/issues Makefile:53: *** Aborting compilation. Stop.
Sorry for the delay, thank you both for the comments and feedback.
According to the manual, uname -p
is non-portable, so it's rather risky (and indeed, non-portable) to use it instead of uname -m
. It's not bad that it returns "Power Macintosh", because it allows to control which hardware/software combination should be compiled or fail, like in this case. Currently, there is no support for PowerPC CPUs which do not support the mfpvr
instruction, like in your case (this is why the program crashes with EXC_BAD_INSTRUCTION
).
I already had a report of a very similar CPU in #196 which did not work properly, where I asked for access to the machine in order to design a fix (didn't happen). Same goes for this issue, if I could have access to one of those machines I would be happy to work on that. As you suggested, sysctl
could probably be used to avoid EXC_BAD_INSTRUCTION
but I would be way more interested in a OS-independent solution.
Machine: PowerBook G4 15" CPU: PowerPC 7450 1.33GHz OS: Mac OS X Tiger 10.4.11
Using gcc7 and gmake, make complains about "Unsupported arch detected: Power Macintosh" with the Makefile. I used the last commit from GitHub.