aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs
diff options
context:
space:
mode:
authortazjin <tazjin@yandex-team.com>2025-01-10 21:49:20 +0300
committertazjin <tazjin@yandex-team.com>2025-01-10 22:40:52 +0300
commit728a72265a5f728b834f703db4ea7f5bb0c2d640 (patch)
tree542dc71565e8b92eb602fdc0d645f29194a34968 /contrib/libs
parentb26d603e9cd211f7303578a8cd901a36ab180608 (diff)
downloadydb-728a72265a5f728b834f703db4ea7f5bb0c2d640.tar.gz
enable libc++ hardening for all sanitizer builds
The sets of bugs detected by sanitizers and libc\+\+ hardening only partially overlap, making it useful to enable libc\+\+ hardening in sanitizer builds, which might be deployed in more "prod-like" environments than auto tests. For example, the Ad Engine has separate sanitizer groups with mirrored production traffic to catch bugs on real-life traffic. commit_hash:e158ea467a96a3a442440f991b18ed1e076e2986
Diffstat (limited to 'contrib/libs')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__config_site10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__config_site b/contrib/libs/cxxsupp/libcxx/include/__config_site
index dc81d088fe..38a2b6abe4 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__config_site
+++ b/contrib/libs/cxxsupp/libcxx/include/__config_site
@@ -52,8 +52,14 @@
# define _LIBCPP_HAS_MUSL_LIBC
#endif
-#ifdef NDEBUG
-# define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_NONE
+#if defined(__has_feature) && (__has_feature(address_sanitizer) || \
+ __has_feature(leak_sanitizer) || \
+ __has_feature(thread_sanitizer) || \
+ __has_feature(memory_sanitizer) || \
+ __has_feature(undefined_behavior_sanitizer))
+# define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_FAST
+#elif defined(NDEBUG)
+# define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_NONE
#else
# define _LIBCPP_HARDENING_MODE_DEFAULT _LIBCPP_HARDENING_MODE_FAST
#endif