[LLVMdev] arm code generation

Chris Lattner sabre at nondot.org
Wed Mar 19 20:46:22 PDT 2008


On Mar 19, 2008, at 8:08 PM, Amichi Amar wrote:

> Hello,
>
> I'm trying to do the following and encountering problems with the  
> generated arm assembly code:
>
> I've got an application in two parts that i've compiled into llvm  
> bitcode using:
> llvm-gcc -emit-llvm -c part1.c -o part1.bc
> llvm-gcc -emit-llvm -c part2.c -o part2.bc
>
> Then I link them together:
> llvm-ld part1.bc part2.bc -o combined.bc
>
> Now I use the ARM backend via llc to generate the assembly for my  
> target processor from combined.bc:
> llc -march=arm -mcpu=arm7tdmi combined.bc
>
> The problem is when I run the generated file (combined.s) through an  
> arm cross compiler for my target (arm-elf gcc toolchain) I get the  
> following errors below. Has anybody encountered this before? Is  
> there a way to do this?
>
For this to work, you need to build llvm-gcc as a cross compiler to  
the appropriate arm target.

-Chris



More information about the llvm-dev mailing list