[libcxx-commits] [libcxx] [llvm] [libcxx][CMake] Rework LLVM_ENABLE_ASSERTIONS interaction w. libcxx hardening (PR #229359)
Jinsong Ji via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 7 08:51:29 PDT 2026
jsji wrote:
> If you really want to improve the build, you need to separate the configuration for the user of libcxx header and the configuration for building libcxx when everything is configured together.
It looks like to me that the issue Maetvies met is due the overriding the default of libcxx (from none to extensive) when doing in-tree build with LLVM_ENABLE_ASSERTIONS.
Would a fix like below be OK for you @cachemeifyoucan?
--
The idea is to restore the libc++ default for the runtimes build while leaving HandleLLVMOptions.cmake untouched.
```
# runtimes/CMakeLists.txt — in runtime_default_target(), before llvm_ExternalProject_Add
if(DEFINED LIBCXX_DEFAULT_HARDENING_MODE)
set(LIBCXX_HARDENING_MODE "${LIBCXX_DEFAULT_HARDENING_MODE}")
endif()
```
If the vendor would like to get the default runtime hardening mode, they can add the code into their cmake cache.
` set(LIBCXX_DEFAULT_HARDENING_MODE "none" CACHE STRING "")
`
https://github.com/llvm/llvm-project/pull/229359
More information about the libcxx-commits
mailing list