From 5196d1eb2745a8f397d3595a33cbe5379680685a Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Fri, 13 Jun 2025 14:18:17 -0700 Subject: [PATCH] Fix the hardening mode defines, also use debug (#5666) This is based on #5664 because it's fixing an issue which `DEBUG` would catch. That's also why I'm switching to `DEBUG` from `EXTENSIVE`; I think we should be okay with the performance cost in `file_test`, which is probably our main concern. Note digging into this also got me to notice that the flags weren't actually enabled; this is fixing the define names. --------- Co-authored-by: Dana Jansens --- bazel/cc_toolchains/clang_cc_toolchain_config.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel/cc_toolchains/clang_cc_toolchain_config.bzl b/bazel/cc_toolchains/clang_cc_toolchain_config.bzl index 3aeea1593a9f..509e2f3b8bf5 100644 --- a/bazel/cc_toolchains/clang_cc_toolchain_config.bzl +++ b/bazel/cc_toolchains/clang_cc_toolchain_config.bzl @@ -653,13 +653,13 @@ def _impl(ctx): )], ) - # Clang HARDENED_MODE has 4 possible values: - # https://releases.llvm.org/18.1.0/projects/libcxx/docs/Hardening.html#hardening-modes + # Clang HARDENING_MODE has 4 possible values: + # https://libcxx.llvm.org/Hardening.html#notes-for-users libcpp_debug_flags = [ - "-D_LIBCPP_ENABLE_HARDENED_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE", + "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG", ] libcpp_release_flags = [ - "-D_LIBCPP_ENABLE_HARDENED_MODE=_LIBCPP_HARDENING_MODE_FAST", + "-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST", ] linux_flags_feature = feature(