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/stats | |
parent | 4ef2dc3fe6295e56f6e24772065b82c5b39b48ad (diff) | |
download | compiler-rt-421408c0f2cc811bcf9a945be6e95e46f76cb358.tar.gz |
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/stats')
-rw-r--r-- | lib/stats/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/stats/CMakeLists.txt b/lib/stats/CMakeLists.txt index 33ab1aea6..ec75262d4 100644 --- a/lib/stats/CMakeLists.txt +++ b/lib/stats/CMakeLists.txt @@ -5,8 +5,14 @@ set_target_properties(stats PROPERTIES FOLDER "Compiler-RT Misc") if(APPLE) set(STATS_LIB_FLAVOR SHARED) + + add_weak_symbols("asan" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS) + add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS) else() set(STATS_LIB_FLAVOR STATIC) + + set(WEAK_SYMBOL_LINKFLAGS) endif() add_compiler_rt_runtime(clang_rt.stats @@ -17,6 +23,7 @@ add_compiler_rt_runtime(clang_rt.stats OBJECT_LIBS RTSanitizerCommon RTSanitizerCommonLibc CFLAGS ${SANITIZER_COMMON_CFLAGS} + LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS} PARENT_TARGET stats) add_compiler_rt_runtime(clang_rt.stats_client @@ -25,4 +32,5 @@ add_compiler_rt_runtime(clang_rt.stats_client OS ${SANITIZER_COMMON_SUPPORTED_OS} SOURCES stats_client.cc CFLAGS ${SANITIZER_COMMON_CFLAGS} + LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS} PARENT_TARGET stats) |