Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS X 10.4.11 PowerPC: make fails with "Unsupported arch detected: Power Macintosh" #234

Open
garoffoli opened this issue Mar 27, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@garoffoli
Copy link

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.

@barracuda156
Copy link

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.

@barracuda156
Copy link

I.e.,

36-231% uname -m
Power Macintosh
36-231% uname -p
powerpc

@barracuda156
Copy link

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 ()

@Dr-Noob
Copy link
Owner

Dr-Noob commented Jul 3, 2024

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.

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.

@Dr-Noob Dr-Noob added the enhancement New feature or request label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants