[LLVMdev] Cross-compiling the ARM toolchain

Liu proljc at gmail.com
Sat Sep 11 16:21:47 PDT 2010


clang -march=armv7-a -mcpu=cortex-a9 -ccc-host-triple
arm-none-linux -ccc-gcc-name arm-none-linux-gnueabi-gcc a.c

replace tripe with yours

2010/9/10 Renato Golin <rengolin at systemcall.org>:
> On 10 September 2010 04:47, Liu <proljc at gmail.com> wrote:
>> trying this:
>> clang -march=armv7-a -mcpu=cortex-a9 -ccc-host-triple
>> arm-none-linux -ccc-gcc-name arm-none-linux-gnueabi-gcc a.c
>
> Hi Liu,
>
> That doesn't work for me.
>
> $ clang -march=armv7-a -mcpu=cortex-a9 -ccc-host-triple arm-none-linux
> -ccc-gcc-name arm-none-linux-gnueabi-gcc alias.c
> clang: warning: unknown platform, assuming -mfloat-abi=soft
> /tmp/cc-0BIpHn.s: Assembler messages:
> /tmp/cc-0BIpHn.s:1: Error: unknown pseudo-op: `.syntax'
> /tmp/cc-0BIpHn.s:2: Error: unknown pseudo-op: `.cpu'
> /tmp/cc-0BIpHn.s:3: Error: unknown pseudo-op: `.eabi_attribute'
> /tmp/cc-0BIpHn.s:4: Error: unknown pseudo-op: `.eabi_attribute'
> /tmp/cc-0BIpHn.s:5: Error: unknown pseudo-op: `.eabi_attribute'
> /tmp/cc-0BIpHn.s:6: Error: unknown pseudo-op: `.eabi_attribute'
> /tmp/cc-0BIpHn.s:7: Error: unknown pseudo-op: `.eabi_attribute'
> /tmp/cc-0BIpHn.s:8: Error: unknown pseudo-op: `.eabi_attribute'
> /tmp/cc-0BIpHn.s:15: Error: no such instruction: `bx lr'
> clang: error: assembler command failed with exit code 1 (use -v to see
> invocation)
>
> The assembly is fine, but ARM's ELF writer is not, if it's even
> getting that far. MC doesn't have ELF yet (right?) and the old ARM ELF
> writer had lots of problems, especially on EABI conformity, but that
> ASM is pure GNU, so I don't know what's wrong with it.
>
> If you generate assembly and pipe it to GAS then link manually, it
> works, but that's far from ideal. I think the long term solution would
> be to implement the MC ELF writer for ARM, but you won't get that in
> the 2.8.
>
>
> --
> cheers,
> --renato
>
> http://systemcall.org/
>
> Reclaim your digital rights, eliminate DRM, learn more at
> http://www.defectivebydesign.org/what_is_drm
>



More information about the llvm-dev mailing list