When ENABLE_HARDENING
is ON
(which is the default) and compiling with libc++ in debug mode, then enable full libc++ hardening.
Inspired by #31272 (comment)
Note that libstdc++
’s _GLIBCXX_ASSERTIONS
(aka light debug mode) is enabled by default when compiling without optimizations), that is in our debug builds. But see #31424 (comment).
Further considerations:
-
Consider enabling
libstdc++
s_GLIBCXX_ASSERTIONS
(aka light debug mode) also in non-debug builds. Should assess performance impact. -
Consider enabling
libc++
s_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST
in non-debug builds. Should assess peformance impact as well.