I am trying to cross-compile libc for RISC-V. During the compilation process, an error message shows up about the host compiler that it doesn’t support the option -fuse-ld=lld. However, it seems like clang really doesn’t support it and it’s not a matter of missing CMake compilation options.
The CMake options used are:
cmake -S llvm -B build -G Ninja
-DLLVM_ENABLE_PROJECTS=“clang;lld”
-DLLVM_ENABLE_RUNTIMES=“libc”
-DDEFAULT_SYSROOT=“/opt/riscv/riscv64-unknown-elf”
-DGCC_INSTALL_PREFIX=“/opt/riscv”
-DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_ASSERTIONS=“ON”
-DLLVM_PARALLEL_LINK_JOBS=1
-DLLVM_TARGETS_TO_BUILD=“RISCV”
-DLLVM_DEFAULT_TARGET_TRIPLE=“riscv64-unknown-elf”
The error message is the following:
[961/985] Performing configure step for ‘runtimes’
– Could NOT find Terminfo (missing: Terminfo_LIBRARIES Terminfo_LINKABLE)
– Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version “1.2.11”)
– Could NOT find Terminfo (missing: Terminfo_LIBRARIES Terminfo_LINKABLE)
– Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version “1.2.11”)
CMake Error at /home/zach/CS-498/forked/llvm-project/llvm/cmake/modules/HandleLLVMOptions.cmake:312 (message):
Host compiler does not support ‘-fuse-ld=lld’
Call Stack (most recent call first):
CMakeLists.txt:149 (include)
– Configuring incomplete, errors occurred!