spinhawk
spinhawk copied to clipboard
Fix autoconf CPU detection on Raspberry Pi
Autoconf falsely detects an "armv7l" CPU on Cortex machines like several Raspberry Pi 3 and 4 models, when they run in 32 bit mode (which they do in current versions of Raspberry Pi OS (previously called Raspbian).
This change works around the issue by correcting the host_cpu in configure.ac.
See also
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70210
- https://savannah.gnu.org/support/index.php?110360
Good
This doesn't work for me.
lscpu | grep 'Model name' | cut -d: -f2 | xargs | tr '[:upper:]' '[:lower:]' results in the following output:
armv7 processor rev 4 (v7l)
and assigning this string to host_cpu is results in failures when make is run.
The original suggestion of setting host_cpu to cortex-a53 works ok for me but I don't know if it works in every other possible case.
host_cpu=cortex-a53 works on Raspberry Pi 3, but Raspberry Pi 4 has cortex-a72. It might be backwards compatible.
would host_cpu=armv7 work? Then another
... | cut -d' ' -f1
should fix it
armv7 doesn't seem to be a legal value, but arm7 is. So
... | cut -d' ' -f1 | sed 's/armv/arm/'
should do it