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

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:


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?


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?