[cfe-dev] Cross Compile problems

Muhui Jiang via cfe-dev cfe-dev at lists.llvm.org
Sat Jun 30 03:59:31 PDT 2018


Hi

I am using the newest version of llvm and clang-7. Now I am try to build a
test.c into a binary. I am doing cross compile and the host is x86_64 while
the target is arm.

I use the following command.

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
--rtlib=compiler-rt -o test test.c

However, I received 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)

Does anyone know the reason or solution? Many Thanks

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


More information about the cfe-dev mailing list