spinhawk icon indicating copy to clipboard operation
spinhawk copied to clipboard

Fix autoconf CPU detection on Raspberry Pi

Open AlgorithMan-de opened this issue 4 years ago • 4 comments

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

AlgorithMan-de avatar Nov 12 '20 10:11 AlgorithMan-de

Good

Hiearl77 avatar Nov 15 '20 23:11 Hiearl77

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.

PeterCoghlan avatar Jun 29 '21 23:06 PeterCoghlan

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

AlgorithMan-de avatar Jun 30 '21 13:06 AlgorithMan-de

armv7 doesn't seem to be a legal value, but arm7 is. So ... | cut -d' ' -f1 | sed 's/armv/arm/' should do it

AlgorithMan-de avatar Jun 30 '21 13:06 AlgorithMan-de