[LLVMdev] Re : Cross-compiler to arm
Hanbing Li
hanbing.li at inria.fr
Fri Nov 7 07:41:30 PST 2014
Hi Aboulaye,
Thank you very much for your information!
For now, I have succeeded in compilation of simple code. When I move to the complex ones, I will use this toolkit.
Thank you!
Sincerely,
Hanbing
----- Mail original -----
> De: "Abdoulaye Walsimou Gaye" <awg at embtoolkit.org>
> À: "Hanbing Li" <hanbing.li at inria.fr>, llvmdev at cs.uiuc.edu
> Envoyé: Jeudi 6 Novembre 2014 19:30:28
> Objet: Re : [LLVMdev] Cross-compiler to arm
> Hello,
> EmbToolkit may be an option for you.
> The latest git source tree is able to give you the needed --sysroot env (with
> different choices of c library) for you target arm, a cross compiler
> (clang/llvm or gcc, or both), build Linux kernel (gcc cross compiler), build
> a root filesystem.
> All this under Mac os X.
> Cheers,
> awg
> ----- Reply message -----
> De : "Hanbing Li" <hanbing.li at inria.fr>
> Pour : <llvmdev at cs.uiuc.edu>
> Objet : [LLVMdev] Cross-compiler to arm
> Date : jeu., nov. 6, 2014 18:21
> Hi list,
> I want to use LLVM to compile the C code to arm.
> Host: Mac OS X 10.10
> Target: Pandaboard, armv7l, ubuntu
> I found some useful information but not worked yet.
> I tried like this:
> $ clang -fomit-frame-pointer -ggdb -emit-llvm
> --target=armv7l-unknown-linux-eabi -mcpu=cortex-a9 —mfpu=neon
> -mfloat-abi=softfp --sysroot=/... test.c -c -o test.bc
> -->
> clang-3.5: error: no such file or directory: '—mfpu=neon'
> clang-3.5: error: -emit-llvm cannot be used when linking
> clang-3.5: error: no such file or directory: '—-sysroot=...'
> when I tried like this:
> $ clang -fomit-frame-pointer -ggdb -emit-llvm
> --target=armv7l-unknown-linux-eabi -mcpu=cortex-a9 test.c -c -o test.bc
> It worked. Then I did:
> $ llc test.bc -o test.s
> And sent the test.s to the pandaboard. On the board, I did:
> $ as -o test.o test.s
> $ ld -e main -o a.out test.o
> $ ./a.out
> -->
> Segmentation fault (core dumped)
> This is what I got.
> The test.c is very simple. Even like
> int main(){
> int i=0;
> return 0;
> }
> Still no work.
> BTW, someone said: Toolchain on host : sudo apt-get install
> gcc-arm-linux-gnueabi
> How to realize this in MacOS?(port or brew)? I also found something here:
> https://launchpad.net/gcc-arm-embedded/+download .
> Is this the same thing or not?
> Does anyone know how to cross-compile from MacOS to arm? Or tell me what's
> wrong with my operations! Any suggestion or information is appreciated!
> Thanks,
> Hanbing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141107/c7406903/attachment.html>
More information about the llvm-dev
mailing list