[LLVMdev] Re : Cross-compiler to arm
Abdoulaye Walsimou Gaye
awg at embtoolkit.org
Thu Nov 6 10:30:28 PST 2014
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 linkingclang-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.bcIt worked. Then I did:$ llc test.bc -o test.sAnd 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 likeint main(){int i=0;return 0;}Still no work.
BTW, someone said: Toolchain on host : sudo apt-get install gcc-arm-linux-gnueabiHow 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/20141106/9630d1d3/attachment.html>
More information about the llvm-dev
mailing list