Bug 1080946 - Don't mark ASAN poisoning functions as dllexport on Windows; r=njn
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 10 Oct 2014 10:33:16 -0400
changeset 209965 c32fd9b9c35576ad66b8365e9adb39cbe478ca78
parent 209964 fcf6d37ae66cf5e3dfecc5d57d935763a19af25d
child 209966 d27ce1e75719e417328b570bec2c6dbcbd5e1de7
push id27632
push userryanvm@gmail.com
push dateSat, 11 Oct 2014 20:21:25 +0000
treeherdermozilla-central@44168a7af20d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1080946
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1080946 - Don't mark ASAN poisoning functions as dllexport on Windows; r=njn
mfbt/MemoryChecking.h
--- a/mfbt/MemoryChecking.h
+++ b/mfbt/MemoryChecking.h
@@ -31,23 +31,31 @@
 #define MOZ_HAVE_MEM_CHECKS 1
 #endif
 
 #if defined(MOZ_ASAN)
 #include <stddef.h>
 
 #include "mozilla/Types.h"
 
+#ifdef _MSC_VER
+// In clang-cl based ASAN, we link against the memory poisoning functions
+// statically.
+#define MOZ_ASAN_VISIBILITY
+#else
+#define MOZ_ASAN_VISIBILITY MOZ_EXPORT
+#endif
+
 extern "C" {
 /* These definitions are usually provided through the
  * sanitizer/asan_interface.h header installed by ASan.
  */
-void MOZ_EXPORT
+void MOZ_ASAN_VISIBILITY
 __asan_poison_memory_region(void const volatile *addr, size_t size);
-void MOZ_EXPORT
+void MOZ_ASAN_VISIBILITY
 __asan_unpoison_memory_region(void const volatile *addr, size_t size);
 
 #define MOZ_MAKE_MEM_NOACCESS(addr, size) \
   __asan_poison_memory_region((addr), (size))
 
 #define MOZ_MAKE_MEM_UNDEFINED(addr, size) \
   __asan_unpoison_memory_region((addr), (size))