I am trying to compile libc using the following cmake command:
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 goal is to cross-compile libc for riscv64.
I am using LLVM version 15.0.1.
After running ninja, an error shows up saying the following:
CMake Error at /home/user/llvm-project/llvm/cmake/modules/CheckProblematicConfigurations.cmake:14 (if):
if given arguments:
"STREQUAL" "MSVC"
Unknown arguments specified
Even if it fixed manually, another one comes up about -fuse-lld not being supported by host compiler.
But, it is already suspicious that manual changes had to be made to partially make it work. Any ideas what might be going on?