arm code generation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

arm code generation

Amichi Amar
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? 


combined.s: Assembler messages:
combined.s:216: rd and rm should be different in mul
... repeated a few times
combined.s:969: rd and rm should be different in mla
... repeated a few times
combined.s:1330: Error: unknown pseudo-op: `.cstring'
combined.s:1335: Error: junk at end of line, first unrecognized character is `,'
.. repeated many times
combined.s:1366: Error: character following name is not '#'
combined.s:1370: Error: unknown pseudo-op: `.indirect_symbol'
combined.s:1375: Error: unknown pseudo-op: `.lazy_symbol_pointer'
combined.s:1377: Error: unknown pseudo-op: `.indirect_symbol'
.. repeated a few times
combined.s:1393: Error: unknown pseudo-op: `.subsections_via_symbols'


Thank you,

-aa



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: arm code generation

Chris Lattner

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
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: arm code generation

Anton Korobeynikov
In reply to this post by Amichi Amar
Hello,

> combined.s:1370: Error: unknown pseudo-op: `.indirect_symbol'
> combined.s:1375: Error: unknown pseudo-op: `.lazy_symbol_pointer'
> combined.s:1377: Error: unknown pseudo-op: `.indirect_symbol'
> .. repeated a few times
> combined.s:1393: Error: unknown pseudo-op: `.subsections_via_symbols'
Looks like you've generated assembler for darwin. Provide correct target
triplet.

--
WBR, Anton Korobeynikov
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: arm code generation

Evan Cheng-2
In reply to this post by Amichi Amar

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? 


combined.s: Assembler messages:
combined.s:216: rd and rm should be different in mul
... repeated a few times
combined.s:969: rd and rm should be different in mla
... repeated a few times

Your assembler is probably outdated. This restriction is not present in newish ARM incarnations.

Evan

combined.s:1330: Error: unknown pseudo-op: `.cstring'
combined.s:1335: Error: junk at end of line, first unrecognized character is `,'
.. repeated many times
combined.s:1366: Error: character following name is not '#'
combined.s:1370: Error: unknown pseudo-op: `.indirect_symbol'
combined.s:1375: Error: unknown pseudo-op: `.lazy_symbol_pointer'
combined.s:1377: Error: unknown pseudo-op: `.indirect_symbol'
.. repeated a few times
combined.s:1393: Error: unknown pseudo-op: `.subsections_via_symbols'


Thank you,

-aa


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev