Skip to content

Commit 5196d1e

Browse files
jonmeowdanakj
andauthored
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 <[email protected]>
1 parent 3b7dc79 commit 5196d1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bazel/cc_toolchains/clang_cc_toolchain_config.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,13 @@ def _impl(ctx):
653653
)],
654654
)
655655

656-
# Clang HARDENED_MODE has 4 possible values:
657-
# https://releases.llvm.org/18.1.0/projects/libcxx/docs/Hardening.html#hardening-modes
656+
# Clang HARDENING_MODE has 4 possible values:
657+
# https://libcxx.llvm.org/Hardening.html#notes-for-users
658658
libcpp_debug_flags = [
659-
"-D_LIBCPP_ENABLE_HARDENED_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
659+
"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG",
660660
]
661661
libcpp_release_flags = [
662-
"-D_LIBCPP_ENABLE_HARDENED_MODE=_LIBCPP_HARDENING_MODE_FAST",
662+
"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST",
663663
]
664664

665665
linux_flags_feature = feature(

0 commit comments

Comments
 (0)