Looking to build compiler-rt with ASSERTS

How can I build compiler-rt with asserts enabled?
Based on what I see for other components:
LIBCXX_ENABLE_ASSERTIONS
LLVM_ENABLE_ASSERTIONS
I grep’d the compiler-t for ENABLE_ASSERTIONS but I don’t find anything.
I am using LLVM 16.0.0 branch.

TIA

LLVM_ENABLE_ASSERTIONS will apply to compiler-rt as well, same if you build with the Debug build type (Building LLVM with CMake — LLVM 18.0.0git documentation).

Generally if there’s an LLVM_* option but no PROJECT_* equivalent, PROJECT respects the LLVM variable.

After I inverted an existing assert in the fuzzer tests it definitely was checked:

Fuzzer-aarch64-Test: /home/david.spickett/llvm-project/compiler-rt/lib/fuzzer/tests/FuzzerUnittest.cpp:1207: void makeCommandArgs(std::vector<std::string> *): Assertion `!ArgsToAdd' failed.
1 Like