[llvm-dev] Cross Compilation Problem

Muhui Jiang via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 1 10:19:26 PDT 2018


Hi Peter

I guess this is the document written by you
https://fosdem.org/2018/schedule/event/crosscompile/attachments/slides/2107/export/events/attachments/crosscompile/slides/2107/How_to_cross_compile_with_LLVM_based_tools.pdf

I follow it to try to use the clang to do cross compilation. Actually, my
target binaries is SPECCPU2006 and autotools based binaries.

However, I failed on the first step. I write a hello world as test.c.  I
refer to your document and download the newest version of arm toolchain.

I use the following command to try to compile the code to binary.

sudo /home/jmh/Downloads/llvm/build/bin/clang
--sysroot=/home/jmh/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/libc
--gcc-toolchain=/home/jmh/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/
-target arm-linux-gnueabi -fuse-ld=lld -L
/home/jmh/Downloads/llvm/build/lib
-I/home/jmh/Downloads/llvm/build/include/ --rtlib=compiler-rt -o test test.c

However, I come across the following exception.

/home/jmh/Downloads/llvm/build/bin/ld.lld: error: cannot open crtbegin.o:
No such file or directory
/home/jmh/Downloads/llvm/build/bin/ld.lld: error: cannot open
/home/jmh/Downloads/llvm/build/lib/clang/7.0.0/lib/linux/libclang_rt.builtins-arm.a:
No such file or directory
/home/jmh/Downloads/llvm/build/bin/ld.lld: error: cannot open
/home/jmh/Downloads/llvm/build/lib/clang/7.0.0/lib/linux/libclang_rt.builtins-arm.a:
No such file or directory
/home/jmh/Downloads/llvm/build/bin/ld.lld: error: cannot open crtend.o: No
such file or directory
clang-7: error: linker command failed with exit code 1 (use -v to see
invocation)

Do you have any ideas or suggestions. I also cc the problem to llvm
community. Anyone who has the same experience. Please help me. Many Thanks

Regards
Muhui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180701/1e134d90/attachment.html>


More information about the llvm-dev mailing list