WebKit Bugzilla
Attachment 343429 Details for
Bug 186957
: Fix ASAN_ENABLED in GCC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186957-20180623123551.patch (text/plain), 4.58 KB, created by
Alicia Boya García
on 2018-06-23 03:35:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alicia Boya García
Created:
2018-06-23 03:35:52 PDT
Size:
4.58 KB
patch
obsolete
>Subversion Revision: 233115 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 42022b3c7f11cac66dac1d1766527bc2b986d184..77e38eb724f948a88076cafce327ceb21d3f6521 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-22 Alicia Boya GarcÃa <aboya@igalia.com> >+ >+ Fix ASAN_ENABLED in GCC >+ https://bugs.webkit.org/show_bug.cgi?id=186957 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ASAN_ENABLED used to rely on Clang-specific features for detection. >+ This patch enables ASAN_ENABLED to work on GCC too. >+ >+ It also fixes compilation errors and warnings that were triggered when >+ compiling code guarded by ASAN_ENABLED in gcc. >+ >+ * wtf/Compiler.h: >+ * wtf/Vector.h: >+ (WTF::VectorBuffer::endOfBuffer): >+ > 2018-06-21 Carlos Garcia Campos <cgarcia@igalia.com> > > [GLIB] improve get_type() fast path in WEBKIT_DEFINE_TYPE >diff --git a/Source/WTF/wtf/Compiler.h b/Source/WTF/wtf/Compiler.h >index 31c2936911ffb96fbb003d4a27b6996ccf804682..77f271ec315c92517b5bf642066a5a197b38b3ea 100644 >--- a/Source/WTF/wtf/Compiler.h >+++ b/Source/WTF/wtf/Compiler.h >@@ -145,7 +145,11 @@ > > /* ASAN_ENABLED and SUPPRESS_ASAN */ > >+#ifdef __SANITIZE_ADDRESS__ >+#define ASAN_ENABLED 1 >+#else > #define ASAN_ENABLED COMPILER_HAS_CLANG_FEATURE(address_sanitizer) >+#endif > > #if ASAN_ENABLED > #define SUPPRESS_ASAN __attribute__((no_sanitize_address)) >@@ -157,7 +161,9 @@ > > /* ALWAYS_INLINE */ > >-#if !defined(ALWAYS_INLINE) && COMPILER(GCC_OR_CLANG) && defined(NDEBUG) && !COMPILER(MINGW) >+/* In GCC functions marked with no_sanitize_address cannot call functions that are marked with always_inline and not marked with no_sanitize_address. >+ * Therefore we need to give up on the enforcement of ALWAYS_INLINE when bulding with ASAN. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 */ >+#if !defined(ALWAYS_INLINE) && COMPILER(GCC_OR_CLANG) && defined(NDEBUG) && !COMPILER(MINGW) && !(COMPILER(GCC) && ASAN_ENABLED) > #define ALWAYS_INLINE inline __attribute__((__always_inline__)) > #endif > >diff --git a/Source/WTF/wtf/Vector.h b/Source/WTF/wtf/Vector.h >index 66e3be2ae688b0fd5e348c074a5c3f54f890a384..dd4a3be2eb36800d14f2607893a23bcd7531216a 100644 >--- a/Source/WTF/wtf/Vector.h >+++ b/Source/WTF/wtf/Vector.h >@@ -528,7 +528,14 @@ public: > void* endOfBuffer() > { > ASSERT(buffer()); >+#if COMPILER(GCC) >+#pragma GCC diagnostic push >+#pragma GCC diagnostic ignored "-Winvalid-offsetof" >+#endif > static_assert((offsetof(VectorBuffer, m_inlineBuffer) + sizeof(m_inlineBuffer)) % 8 == 0, "Inline buffer end needs to be on 8 byte boundary for ASan annotations to work."); >+#if COMPILER(GCC) >+#pragma GCC diagnostic pop >+#endif > > if (buffer() == inlineBuffer()) > return reinterpret_cast<char*>(m_inlineBuffer) + sizeof(m_inlineBuffer); >diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog >index 3524c351547fbdf51462a94d1adb7713b5ece201..afbc5b7a4eaf17b6af9d461766315475a7a9638d 100644 >--- a/PerformanceTests/ChangeLog >+++ b/PerformanceTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-06-22 Alicia Boya GarcÃa <aboya@igalia.com> >+ >+ Fix ASAN_ENABLED in GCC >+ https://bugs.webkit.org/show_bug.cgi?id=186957 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Updated Compiler.h to reflect changes in WTF. >+ >+ * StitchMarker/wtf/Compiler.h: >+ > 2018-06-08 Jon Lee <jonlee@apple.com> > > [MotionMark] Rename Suits test files >diff --git a/PerformanceTests/StitchMarker/wtf/Compiler.h b/PerformanceTests/StitchMarker/wtf/Compiler.h >index f2fed798cd4cb35b75e7f891ce8caef9cc9e8d6e..a23defd86905eb269da8d10016d2ff30bf05f708 100644 >--- a/PerformanceTests/StitchMarker/wtf/Compiler.h >+++ b/PerformanceTests/StitchMarker/wtf/Compiler.h >@@ -166,7 +166,11 @@ > #endif > #endif > >+#ifdef __SANITIZE_ADDRESS__ >+#define ASAN_ENABLED 1 >+#else > #define ASAN_ENABLED COMPILER_HAS_CLANG_FEATURE(address_sanitizer) >+#endif > > #if ASAN_ENABLED > #define SUPPRESS_ASAN __attribute__((no_sanitize_address)) >@@ -178,7 +182,9 @@ > > /* ALWAYS_INLINE */ > >-#if !defined(ALWAYS_INLINE) && COMPILER(GCC_OR_CLANG) && defined(NDEBUG) && !COMPILER(MINGW) >+/* In GCC functions marked with no_sanitize_address cannot call functions that are marked with always_inline and not marked with no_sanitize_address. >+ * Therefore we need to give up on the enforcement of ALWAYS_INLINE when bulding with ASAN. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 */ >+#if !defined(ALWAYS_INLINE) && COMPILER(GCC_OR_CLANG) && defined(NDEBUG) && !COMPILER(MINGW) && !(COMPILER(GCC) && ASAN_ENABLED) > #define ALWAYS_INLINE inline __attribute__((__always_inline__)) > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186957
:
343408
|
343429
|
343442
|
343445
|
343500