WebKit Bugzilla
Attachment 343500 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-20180625173218.patch (text/plain), 2.80 KB, created by
Alicia Boya García
on 2018-06-25 08:32:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alicia Boya García
Created:
2018-06-25 08:32:19 PDT
Size:
2.80 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..306f46249d257eb365efd2cb439d5daebc2d38d9 100644 >--- a/Source/WTF/wtf/Vector.h >+++ b/Source/WTF/wtf/Vector.h >@@ -528,7 +528,15 @@ 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);
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