[cfe-users] A Problem When Cross Compiling for RISC-V in Clang

张尹 via cfe-users cfe-users at lists.llvm.org
Fri Jun 12 19:58:48 PDT 2020


Hello everybody,

I met a problem when cross compiling for RISC-V in Clang.


'''
/home/test# /home/git/rvv-llvm/build/bin/clang++ --target=riscv64-unknown-linux-gnu --sysroot=/home/RISCV/sysroot/ -I /home/RISCV/riscv64-unknown-linux-gnu/include/c++/9.2.0/ -I /home/RISCV/riscv64-unknown-linux-gnu/include/c++/9.2.0/riscv64-unknown-linux-gnu/ -L /home/RISCV/lib/gcc/riscv64-unknown-linux-gnu/9.2.0/ test.cpp
/home/RISCV/bin/riscv64-unknown-linux-gnu-ld: cannot find crtbegin.o: No such file or directory
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
'''


The file "crtbegin.o" is actually in the directory added by the -L option.


'''
/home/RISCV# find . -name "crtbegin.o"
./lib/gcc/riscv64-unknown-linux-gnu/9.2.0/crtbegin.o
'''


I finally add a soft link of the file to finish compiling. But do you know why ld cannot find it?

sincerely,
Yin




More information about the cfe-users mailing list