Building LLVM cross compiler runtime libraries via Visual Studio

I have built an LLVM cross compiler (targeting RISCV) using Visual Studio 2019 using this configuration command:

cmake -G “Visual Studio 16 2019” -DLLVM_ENABLE_PROJECTS=“clang;lld” -DLLVM_ENABLE_RUNTIMES=“libcxx;libcxxabi” -triple=riscv64-unknown-elf -A x64 -Thost=x64 …\llvm-project\llvm

The compiler and linker build fine, but I get preprocessor errors when the LLVM_ENABLE_RUNTIMES code tries to build. I suspect the build is trying to use the Visual Studio preprocessor. A bunch of errors are being generated for the #include_next directive.

Is their another configuration command (or something else) I need to tell it to use the clang tools to build the runtime libraries?


You can try these instructions to build an LLVM cross compiler targeting RISCV : GitHub - sifive/riscv-llvm: SiFive's LLVM working tree