From 417c9bcba10006e773e24cbed1ddb9b16712ceb0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 23 Apr 2014 11:23:28 -0700 Subject: [PATCH] * conf_post.h (ADDRESS_SANITIZER_WORKAROUND): Port to GCC 4.9.0 and to clang 3.4, which have fixed the bug. This should let us run a bit faster on these platforms when address sanitization is in effect. --- src/ChangeLog | 7 +++++++ src/conf_post.h | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fdbf922173..1a4c29f258 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-04-23 Paul Eggert + + * conf_post.h (ADDRESS_SANITIZER_WORKAROUND): Port to GCC 4.9.0 + and to clang 3.4, which have fixed the bug. This should let us + run a bit faster on these platforms when address sanitization is + in effect. + 2014-04-22 Paul Eggert Port to GCC 4.9.0 with --enable-gcc-warnings. diff --git a/src/conf_post.h b/src/conf_post.h index 2e78c2f5e2..95b028a66e 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -226,14 +226,14 @@ extern void _DebPrint (const char *fmt, ...); /* Work around GCC bug 59600: when a function is inlined, the inlined code may have its addresses sanitized even if the function has the - no_sanitize_address attribute. This bug is present in GCC 4.8.2 - and clang 3.3, the latest releases as of December 2013, and the - only platforms known to support address sanitization. When the bug - is fixed the #if can be updated accordingly. */ -#if ADDRESS_SANITIZER -# define ADDRESS_SANITIZER_WORKAROUND NO_INLINE + no_sanitize_address attribute. This bug is fixed in GCC 4.9.0 and + clang 3.4. */ +#if (! ADDRESS_SANITIZER \ + || ((4 < __GNUC__ + (9 <= __GNUC_MINOR__)) \ + || 3 < __clang_major__ + (4 <= __clang_minor__))) +# define ADDRESS_SANITIZER_WORKAROUND /* No workaround needed. */ #else -# define ADDRESS_SANITIZER_WORKAROUND +# define ADDRESS_SANITIZER_WORKAROUND NO_INLINE #endif /* Attribute of functions whose code should not have addresses -- 2.20.1