The box itself is an Allwinner A10; armv7l. /proc/cpuinfo says it's got
swp half thumb fastmult vfp edsp neon vfpv3.
Yes, it's a Cortex-A8.
I've been unable to find any values for CPU which are accepted (it just
says 'unknown target CPU'. I've tried arm, armv7, armv7a, armv7l, arm7,
armv4t... Any suggestions? Is there a way to get clang and llc to emit a
list of what triples they support?
armv7 and armv7a should default to Cortex-A8, "arm" will default to 7TDMI.
Auto-detected wrongly (as expected),
"/usr/bin/clang" -cc1 -triple armv4t-unknown-linux-gnueabihf -S
Defaulted to armv4t == ARM7TDMI.
I'm particularly curious about the way that the triple passed into the
compiler backend starts 'armv4t' when it's rejected as a CPU type if I
specify it manually.
What does: 'clang -v -mcpu=cortex-a8 -S -O3 test.c' prints as a target?
Just need to do that on the latest Clang, and only paste the target line.
But this *should* all be auto-detected, right?
Should, but it isn't. Unfortunately, auto-detection in the ARM world is not
as simple as in the Intel world, and it's just not implemented.
If your compiler's name is "armv7a-unknown-linux-gnueabihf-clang", you
might get it right, since that part is implemented and should guess
cortex-a8 (not because it'll detect your CPU, but because it's hard-coded
armv7 -> A8).
If I'm using the JIT, I
shouldn't need platform-specific knowledge to set up the code generator?
You should. The IR (which the execution engine runs) is not platform
independent. The front-end has to make some assumptions when generating IR,
depending on the platform, so you need to generate the correct code to
Also, as Amara said, you can set hard-float manually, in the execution
engine, but if your CPU is still v4, I don't think it'll work. You should
make sure you got a v7, than force hard-float, and NEON, and then you'll
get the execution correct. However, if your command line contains
"-mcpu=cortex-a8", you should get all that for free when you build your
Target with the triple above.