This allows crtbegin and crtend to be built, allowing RISC-V to no longer rely on implementations from libgcc.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Here's the flags I'm using for my build.
cmake llvm-project/compiler-rt -G "Ninja" -DCMAKE_INSTALL_PREFIX=<llvm_install>/riscv32-unknown-elf -DCOMPILER_RT_BUILD_BUILTINS=ON -DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_PROFILE=OFF -DCMAKE_C_COMPILER=<llvm_install>/bin/clang -DCMAKE_AR=<llvm_install>/bin/llvm-ar -DCMAKE_NM=<llvm_install>/bin/llvm-nm -DCMAKE_RANLIB=<llvm_install>/bin/llvm-ranlib -DCMAKE_C_COMPILER_TARGET="riscv32-unknown-elf" -DCMAKE_ASM_COMPILER_TARGET="riscv32-unknown-elf" -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON -DLLVM_CONFIG_PATH=<llvm_install>/bin/llvm-config -DCMAKE_C_FLAGS="-march=rv32gc -mabi=ilp32d" -DCMAKE_ASM_FLAGS="-march=rv32gc -mabi=ilp32d" -DCMAKE_EXE_LINKER_FLAGS="-nostartfiles -nostdlib" -DCOMPILER_RT_BAREMETAL_BUILD=ON -DCOMPILER_RT_OS_DIR=""
Comment Actions
I have finally got the runtimes building. There's basically no documentation for the compiler-rt build system, which is very infuriating. Instead I needed to do a close reading of the cmake sources. I believe I have the correct configuration now, which I need to save somewhere (potentially so it becomes available for others).
Yes, this patch is required to ensure that you can build the compiler-rt builtins and the compiler-rt crtbegin and crtend. I am happy for it to land.