I could successfully build llvm for riscv64-unknown-linux-gnu target.
But when I use clang+lld to build hello-world program, I get the following error although I pass the “-mno-relax” flag to clang. Any idea what the problem could be?
with “-mno-relax” flag:
./_install/bin/clang -fuse-ld=lld -mno-relax -o hello hello.c
ld.lld: error: static-reloc.c:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
without “-mno-relax” flag:
./_install/bin/clang -fuse-ld=lld -o hello hello.c
ld.lld: error: static-reloc.c:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
ld.lld: error: hello.c:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
" ./_install/bin/clang -o hello hello.c" works well, but it’s using gnu linker instead.