diff options
author | Francis Ricci <francisjricci@gmail.com> | 2017-01-07 00:31:24 +0000 |
---|---|---|
committer | Francis Ricci <francisjricci@gmail.com> | 2017-01-07 00:31:24 +0000 |
commit | 421408c0f2cc811bcf9a945be6e95e46f76cb358 (patch) | |
tree | 6edd756fe14bfddcc92abfc231d4a5799ca6b291 /lib/tsan | |
parent | 4ef2dc3fe6295e56f6e24772065b82c5b39b48ad (diff) |
Enable weak hooks on darwin
Summary:
By default, darwin requires a definition for weak interface functions at
link time. Adding the '-U' link flag with each weak function allows these
weak interface functions to be used without definitions, which mirrors
behavior on linux and windows.
Reviewers: compnerd, eugenis
Subscribers: kubabrecka, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D28203
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan')
-rw-r--r-- | lib/tsan/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tsan/CMakeLists.txt b/lib/tsan/CMakeLists.txt index b26a884b1..75d26349a 100644 --- a/lib/tsan/CMakeLists.txt +++ b/lib/tsan/CMakeLists.txt @@ -107,6 +107,10 @@ if(APPLE) # Pass ASM file directly to the C++ compiler. set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES LANGUAGE C) endif() + + add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS) + add_compiler_rt_runtime(clang_rt.tsan SHARED OS ${TSAN_SUPPORTED_OS} @@ -117,6 +121,7 @@ if(APPLE) RTSanitizerCommonLibc RTUbsan CFLAGS ${TSAN_RTL_CFLAGS} + LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS} PARENT_TARGET tsan) add_compiler_rt_object_libraries(RTTsan_dynamic OS ${TSAN_SUPPORTED_OS} |