Existing .cmake files errors that require manual update of them

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?

This implies that CMAKE_CXX_COMPILER_ID is empty. Leading you to get if ( STREQUAL MSVC).

This should have been detected early in configuration, perhaps there is something strange about your C++ compiler? I think it will print the result of the detection very early in the cmake output.

The LLVM libc does not yet support RISCV.

What is your host system?

https://libc.llvm.org/index.html

My host system runs on X86_64.

I have extended the LLVM RISC-V backend to support some vendor-specific instructions and I thought that if libc isn’t compiled with the new just-built compiler it won’t contain those instructions.

So, there’s no way to compile libc to contain these newly implemented instructions?

https://reviews.llvm.org/D127571