summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/asan/CMakeLists.txt2
-rw-r--r--compiler-rt/lib/asan/asan_init_version.h11
-rw-r--r--compiler-rt/lib/asan/asan_interface_internal.h6
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h6
4 files changed, 11 insertions, 14 deletions
diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt
index 69c0cd8c263..b23a7a2e5ab 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 -DSANITIZER_DLL_THUNK
+ CFLAGS ${ASAN_CFLAGS} -DASAN_DLL_THUNK
DEFS ${ASAN_COMMON_DEFINITIONS})
add_dependencies(asan clang_rt.asan_dll_thunk-${arch})
endif()
diff --git a/compiler-rt/lib/asan/asan_init_version.h b/compiler-rt/lib/asan/asan_init_version.h
index 88eb80fedcc..77aea81bd29 100644
--- a/compiler-rt/lib/asan/asan_init_version.h
+++ b/compiler-rt/lib/asan/asan_init_version.h
@@ -15,21 +15,16 @@
#ifndef ASAN_INIT_VERSION_H
#define ASAN_INIT_VERSION_H
-#include "sanitizer_common/sanitizer_internal_defs.h"
-
extern "C" {
- // This function should be called at the very beginning of the process,
- // before any instrumented code is executed and before any call to malloc.
- // Every time the ASan ABI changes we also change the version number in this
- // name. Objects build with incompatible ASan ABI version
- // will not link with run-time.
+ // Every time the ASan ABI changes we also change the version number in the
+ // __asan_init function name. Objects built with incompatible ASan ABI
+ // versions will not link with run-time.
// Changes between ABI versions:
// v1=>v2: added 'module_name' to __asan_global
// v2=>v3: stack frame description (created by the compiler)
// contains the function PC as the 3-rd field (see
// DescribeAddressIfStack).
// v3=>v4: added '__asan_global_source_location' to __asan_global.
- SANITIZER_INTERFACE_ATTRIBUTE void __asan_init_v4();
#define __asan_init __asan_init_v4
#define __asan_init_name "__asan_init_v4"
}
diff --git a/compiler-rt/lib/asan/asan_interface_internal.h b/compiler-rt/lib/asan/asan_interface_internal.h
index 32629ea3126..4d3d8bb4de8 100644
--- a/compiler-rt/lib/asan/asan_interface_internal.h
+++ b/compiler-rt/lib/asan/asan_interface_internal.h
@@ -22,6 +22,12 @@
using __sanitizer::uptr;
extern "C" {
+ // This function should be called at the very beginning of the process,
+ // before any instrumented code is executed and before any call to malloc.
+ // Please note that __asan_init is a macro that is replaced with
+ // __asan_init_vXXX at compile-time.
+ SANITIZER_INTERFACE_ATTRIBUTE void __asan_init();
+
// This structure is used to describe the source location of a place where
// global was defined.
struct __asan_global_source_location {
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index 8832da06909..c8985b49eb8 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -17,11 +17,7 @@
// Only use SANITIZER_*ATTRIBUTE* before the function return type!
#if SANITIZER_WINDOWS
-# if defined(SANITIZER_DLL_THUNK)
-# define SANITIZER_INTERFACE_ATTRIBUTE
-# else
-# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllexport)
-# endif
+# define SANITIZER_INTERFACE_ATTRIBUTE __declspec(dllexport)
// FIXME find out what we need on Windows, if anything.
# define SANITIZER_WEAK_ATTRIBUTE
#elif defined(SANITIZER_GO)
OpenPOWER on IntegriCloud