diff options
| author | Alan Wu <alanwu@ruby-lang.org> | 2024-12-16 17:11:36 -0500 |
|---|---|---|
| committer | Alan Wu <alanwu@ruby-lang.org> | 2024-12-16 17:11:36 -0500 |
| commit | 2102fe32ff8191ad51001daf57a1ed09a1ebc824 (patch) | |
| tree | 1ad5520b10b69b4f711ce24010fafe724b799ecd /internal | |
| parent | 0a99daa3216c298695a5fc595fc772ebc5d1834c (diff) | |
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
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/sanitizers.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 <sanitizer/asan_interface.h> # endif |
