summaryrefslogtreecommitdiff
path: root/lib/stats
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-01-09 03:51:42 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-01-09 03:51:42 +0000
commitae4b8805fdce22aacb5644520c4dc42ce2656ebf (patch)
tree77e6862afbfa593d23c5069cfd364d3334be406a /lib/stats
parentcf0113c530ec1a9e44a3fcec909ee10725df5347 (diff)
downloadcompiler-rt-ae4b8805fdce22aacb5644520c4dc42ce2656ebf.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@291417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/stats')
-rw-r--r--lib/stats/CMakeLists.txt8
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)