This is obviously bogus as the cross toolchain has been building arm instructions this whole time. The actual error is caused by a libtool compile command which invokes armv7l-unknown-linux-musleabi-gcc on the file. If I run the same command outside of libtool I get the same error. If I try to run the assembler (armv7l-unknown-linux-musleabi-as) directly on the file it of course complains a lot about not understanding the #include directives but there is no error about the current cpu not supporting arm opcodes. In fact it appears as though it correctly recognizes the target cpu is ARM because it emits messages like "Error: selected processor does not support `vldrle d0,[r0]' in ARM mode."
I have looked around a bit and it seems there are existing bugs of mentioning how gcc does not correctly autodetect the cpu when the target arch is armv7.
GCC Bug 70210
GCC Bug 83206
This got me thinking maybe I should be explicitly stating the mcpu in make.conf. However, in the discussion for bug 70210, a developer says "armv7l is not a valid argument to -mcpu by design." If that's not a valid argument for mcpu, then I have no idea what I should set it to. /proc/cpuinfo just says it is an "ARMv7 Processor rev 5 (v7l)". GCC says these are the only valid arguments to mcpu:
Code: Select all
arm8 arm810 strongarm strongarm110 fa526 fa626 arm7tdmi arm7tdmi-s arm710t arm720t arm740t arm9 arm9tdmi arm920t arm920 arm922t arm940t ep9312 arm10tdmi arm1020t arm9e arm946e-s arm966e-s arm968e-s arm10e arm1020e arm1022e xscale iwmmxt iwmmxt2 fa606te fa626te fmp626 fa726te arm926ej-s arm1026ej-s arm1136j-s arm1136jf-s arm1176jz-s arm1176jzf-s mpcorenovfp mpcore arm1156t2-s arm1156t2f-s cortex-m1 cortex-m0 cortex-m0plus cortex-m1.small-multiply cortex-m0.small-multiply cortex-m0plus.small-multiply generic-armv7-a cortex-a5 cortex-a7 cortex-a8 cortex-a9 cortex-a12 cortex-a15 cortex-a17 cortex-r4 cortex-r4f cortex-r5 cortex-r7 cortex-r8 cortex-m7 cortex-m4 cortex-m3 marvell-pj4 cortex-a15.cortex-a7 cortex-a17.cortex-a7 cortex-a32 cortex-a35 cortex-a53 cortex-a57 cortex-a72 cortex-a73 exynos-m1 xgene1 cortex-a57.cortex-a53 cortex-a72.cortex-a53 cortex-a73.cortex-a35 cortex-a73.cortex-a53 cortex-a55 cortex-a75 cortex-a76 cortex-a76ae cortex-a77 cortex-a78 cortex-a78ae cortex-a78c cortex-a710 cortex-x1 cortex-x1c neoverse-n1 cortex-a75.cortex-a55 cortex-a76.cortex-a55 neoverse-v1 neoverse-n2 cortex-m23 cortex-m33 cortex-m35p cortex-m55 star-mc1 cortex-m85 cortex-r52 cortex-r52plusOR Maybe I am chasing down completely wrong leads here. Any suggestions are welcome. Thank you.

