[LLVMdev] A Question to LLVM

Renato Golin renato.golin at linaro.org
Tue May 13 05:32:31 PDT 2014


On 13 May 2014 13:22, qw <qiuwei-qiuwei at 163.com> wrote:
> clang -c d:\aa.c -emit-llvm -o aa.bc
> llc aa.bc -march=arm -filetype=obj -o aa.elf


Hi Steven,

As Tim said, try:

$ clang -target armv6m-none-eabi -c d:\aa.c -emit-llvm -o aa.bc

Otherwise, Clang will generate binaries to the target platform, you
your case, probably an x86_64 Windows. On its own, llc cannot
transform an IR that was emitted to x86_64 to an ARM IR, which are
reasonably different.

Once you have an ARMv6 IR, llc will create an ELF object even without
-march of -filetype parameters.

cheers,
--renato



More information about the llvm-dev mailing list