From 2102fe32ff8191ad51001daf57a1ed09a1ebc824 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Mon, 16 Dec 2024 17:11:36 -0500 Subject: [PATCH] Detect ASAN when using older GCC versions Newer GCCs have __has_feature and older ones have __SANITIZE_ADDRESS__[1]. Relevant since ASAN with GCC 11 on the popular Ubuntu Jammy failed to build previously. [1]: https://gcc.gnu.org/onlinedocs/gcc-4.8.0/cpp/Common-Predefined-Macros.html --- internal/sanitizers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/sanitizers.h b/internal/sanitizers.h index 0a830ae8f9..becf60bac2 100644 --- a/internal/sanitizers.h +++ b/internal/sanitizers.h @@ -16,7 +16,7 @@ #endif #ifdef HAVE_SANITIZER_ASAN_INTERFACE_H -# if __has_feature(address_sanitizer) +# if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) # define RUBY_ASAN_ENABLED # include # endif