diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.cpp b/compiler-rt/lib/tsan/rtl/tsan_flags.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_flags.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_flags.cpp @@ -13,6 +13,7 @@ #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_flag_parser.h" #include "sanitizer_common/sanitizer_libc.h" +#include "tsan_interface.h" #include "tsan_flags.h" #include "tsan_rtl.h" #include "tsan_mman.h" @@ -21,14 +22,10 @@ namespace __tsan { // Can be overriden in frontend. -#ifdef TSAN_EXTERNAL_HOOKS -extern "C" const char* __tsan_default_options(); -#else SANITIZER_WEAK_DEFAULT_IMPL const char *__tsan_default_options() { return ""; } -#endif void Flags::SetDefaults() { #define TSAN_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface.h b/compiler-rt/lib/tsan/rtl/tsan_interface.h --- a/compiler-rt/lib/tsan/rtl/tsan_interface.h +++ b/compiler-rt/lib/tsan/rtl/tsan_interface.h @@ -32,6 +32,8 @@ // before any instrumented code is executed and before any call to malloc. SANITIZER_INTERFACE_ATTRIBUTE void __tsan_init(); +SANITIZER_INTERFACE_ATTRIBUTE const char* __tsan_default_options(); + SANITIZER_INTERFACE_ATTRIBUTE void __tsan_flush_memory(); SANITIZER_INTERFACE_ATTRIBUTE void __tsan_read1(void *addr);