diff options
author | Timur Iskhodzhanov <timurrrr@google.com> | 2014-07-11 13:46:05 +0000 |
---|---|---|
committer | Timur Iskhodzhanov <timurrrr@google.com> | 2014-07-11 13:46:05 +0000 |
commit | b680e8493d935c5694ddf106916d66810767030e (patch) | |
tree | 56ab311a0fdb7d2d0724de4c67d13ce8b4478409 | |
parent | 734176b59fe6c2ed8507e990b3c4b2a893403913 (diff) | |
download | compiler-rt-b680e8493d935c5694ddf106916d66810767030e.tar.gz |
[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...
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212815 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/asan/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/sanitizer_common/sanitizer_internal_defs.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt index b23a7a2e5..69c0cd8c2 100644 --- a/lib/asan/CMakeLists.txt +++ b/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/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h index c8985b49e..8832da069 100644 --- a/lib/sanitizer_common/sanitizer_internal_defs.h +++ b/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) |