[LLVMdev] [Questions] clang cross compilation and SimpleScalar simulation

陳奕梅 ymchen at sslab5.cs.nctu.edu.tw
Wed Sep 26 00:21:42 PDT 2012


Dear all

I use arm-linux-gcc 2.95.2, because the code generated by version 3.X and
4.X can not run on SimpleScalar.
So I use the arm-linux-gcc 2.95.2 *only*, the version is recommended by
SimpleScalar.
The code generated by arm-linux-gcc 2.95.2 can run on SimpleScalar.
Now I want to use llvm/clang to generate ARM assembly code and
arm-linux-gcc 2.95.2 to be assembler.
Unfortunately, I got some error messages below :

hello.s: Assembler messages:
hello.s:1: Error: Unknown pseudo-op:  `.syntax'
hello.s:2: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:3: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:4: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:5: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:6: Error: Unknown pseudo-op:  `.eabi_attribute'
make: *** [all] Error 1

Then I try commends :
$ clang -ccc-host-triple armv4-none-linux-gnueabi -c hello.c -emit-llvm -o
hello.bc
$ llc -O3 -o hello.s -march=arm -mcpu=strongarm1100 hello.bc
$ arm-linux-gcc -mcpu=strongarm1100 hello.s -static -O3 -o hello

 I got some error messages:

hello.s: Assembler messages:
hello.s:1: Error: Unknown pseudo-op:  `.syntax'
hello.s:2: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:3: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:4: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:5: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:6: Error: Unknown pseudo-op:  `.eabi_attribute'
hello.s:14: Error: bad instruction `push {r11,lr}'
hello.s:18: Error: bad instruction `pop {r11,lr}'
hello.s:28: Warning: Unrecognized .section attribute: want a,w,x
hello.s:28: Warning: Unrecognized .section attribute: want a,w,x
hello.s:28: Error: Rest of line ignored. First ignored character is `,'

P.S.
The version recommended by SimpleScalar :
gcc 2.95.2
binutils 2.10
glibc 2.1.3

Thanks a lot !

Best regards, :)

Yi-Mei Chen

2012/9/26 陳韋任 (Wei-Ren Chen) <chenwj at iis.sinica.edu.tw>

> Hi Jim,
>
> On Tue, Sep 25, 2012 at 10:52:58AM -0700, Jim Grosbach wrote:
> > These errors are from the assembler, not LLVM. Specifically, your
> binutils is
> > too old. Given that it doesn't even recognize the ".syntax" directive,
> they're
> > *very* much too old. You need to upgrade.
> > -Jim
>
>   She said in her previous mail,
>
>     P.S. Because I got error when I use arm-linux-gcc (gcc version 3.X or
> 4.X),
>     I use officially recommended version 2.95,2.
>
>   I don't know what's her problem while using newer toolchain. :/
>
>   奕梅,you should use latest toolchain if possible, and post your problem
> here
> to see if it comes from LLVM/Clang or other place. Also, where do you read
> that
> version is recommended?
>
> Regards,
> chenwj
>
> --
> Wei-Ren Chen (陳韋任)
> Computer Systems Lab, Institute of Information Science,
> Academia Sinica, Taiwan (R.O.C.)
> Tel:886-2-2788-3799 #1667
> Homepage: http://people.cs.nctu.edu.tw/~chenwj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120926/848a1b48/attachment.html>


More information about the llvm-dev mailing list