mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 22:02:41 +01:00
In llvm 17 the _LIBCPP_ENABLE_ASSERTIONS flag was split into two: - _LIBCPP_ENABLE_HARDENED_MODE for fast checks - _LIBCPP_ENABLE_DEBUG_MODE for expensive checks We kept HARDENED_MODE enabled in debug, but we can also turn it on for opt builds. In llvm 18, the _LIBCPP_ENABLE_HARDENED_MODE was further split into 4 settings, NONE, FAST, EXTENSIVE, DEBUG. As seen in the recent blog post https://security.googleblog.com/2024/11/retrofitting-spatial-safety-to-hundreds.html the FAST hardening mode is indeed very fast and has minimal impact, while helping to catch a lot of bugs. So we enable the FAST checks in opt builds, and EXTENSIVE checks in debug builds. The EXTENSIVE checks are the same that Chrome enables in every build configuration, so we could consider enabling it in opt builds as well: https://source.chromium.org/chromium/chromium/src/+/main:build/config/compiler/BUILD.gn;l=1127;drc=a8260dee097dde71ca4464c0c8d897a80c353db2