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
Segmentation fault (core dumped)
This is what I got.
The test.c is very simple. Even like
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!