summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2014-07-11 13:46:05 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2014-07-11 13:46:05 +0000
commit03f1e408dee68ff5a3cd9da49ebaa7d56a2b39d2 (patch)
tree148dc1834dc027ed0dd4345d58f3be6e7a9911d5
parenta2c4950e6e32e7f39e9fbec90e57024e410a9bde (diff)
downloadbcm5719-llvm-03f1e408dee68ff5a3cd9da49ebaa7d56a2b39d2.tar.gz
bcm5719-llvm-03f1e408dee68ff5a3cd9da49ebaa7d56a2b39d2.zip
[ASan/Win] Don't apply dllexport to __asan_init in the DLL thunk
This fixes '___asan_init_v4 already defined' errors when linking some of Chromium DLLs. Looks like one of the DLL is using a .lib produced while linking another DLL and it exploded after r212699. I'm trying to come up with a small testcase... llvm-svn: 212815
-rw-r--r--compiler-rt/lib/asan/CMakeLists.txt2
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt
index b23a7a2e5ab..69c0cd8c263 100644
--- a/compiler-rt/lib/asan/CMakeLists.txt
+++ b/compiler-rt/lib/asan/CMakeLists.txt
@@ -179,7 +179,7 @@ else()
add_compiler_rt_runtime(clang_rt.asan_dll_thunk-${arch} ${arch} STATIC
SOURCES asan_dll_thunk.cc
$<TARGET_OBJECTS:RTInterception.${arch}>
- CFLAGS ${ASAN_CFLAGS} -DASAN_DLL_THUNK
+ CFLAGS ${ASAN_CFLAGS} -DASAN_DLL_THUNK -DSANITIZER_DLL_THUNK
DEFS ${ASAN_COMMON_DEFINITIONS})
add_dependencies(asan clang_rt.asan_dll_thunk-${arch})
endif()
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index c8985b49eb8..8832da06909 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -17,7 +17,11 @@
// Only use SANITIZER_*ATTRIBUTE* before the function return type!
#if SANITIZER_WINDOWS
-# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllexport)
+# if defined(SANITIZER_DLL_THUNK)
+# define SANITIZER_INTERFACE_ATTRIBUTE
+# else
+# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllexport)
+# endif
// FIXME find out what we need on Windows, if anything.
# define SANITIZER_WEAK_ATTRIBUTE
#elif defined(SANITIZER_GO)
OpenPOWER on IntegriCloud