I am using the following CMake options while building the llvm from the source:
cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=True -DLLVM_USE_SPLIT_DWARF=True -DCMAKE_INSTALL_PREFIX="../../install" -DLLVM_OPTIMIZED_TABLEGEN=True -DLLVM_BUILD_TESTS=False -DDEFAULT_SYSROOT="../../install/riscv64-unknown-elf" -DLLVM_DEFAULT_TARGET_TRIPLE="riscv64-unknown-elf" -DLLVM_TARGETS_TO_BUILD="RISCV" ../llvm
- When I execute this command, I am getting the following warning by CMake:
CMake Warning:
Manually-specified variables were not used by the project:
DEFAULT_SYSROOT
- Also, CMake is unable to locate some of the common C libraries and gives messages regarding this, e.g:
Looking for malloc/malloc.h - not found
Looking for CrashReporterClient.h - not found
-
When llvm finishes building, clang is unable to find math.h library.
-
Also, do I need to build libc, and libc++ if I want to compile code for the RISCV target?
Kindly help if you know how can I get these issues resolved .