summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/CMakeLists.txt
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-01-07 00:31:24 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-01-07 00:31:24 +0000
commit1d3577537992b862fb9c70f9adc1ad1a4cb09766 (patch)
tree30a4c27576adfc0f96a48d503fd9508caea12180 /compiler-rt/lib/asan/CMakeLists.txt
parent9a2a9922ca12260cf2cf0d6ac3410e1a8493be76 (diff)
downloadbcm5719-llvm-1d3577537992b862fb9c70f9adc1ad1a4cb09766.tar.gz
bcm5719-llvm-1d3577537992b862fb9c70f9adc1ad1a4cb09766.zip
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 llvm-svn: 291314
Diffstat (limited to 'compiler-rt/lib/asan/CMakeLists.txt')
-rw-r--r--compiler-rt/lib/asan/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt
index 1258ef6165b..4bebb0a45a6 100644
--- a/compiler-rt/lib/asan/CMakeLists.txt
+++ b/compiler-rt/lib/asan/CMakeLists.txt
@@ -106,6 +106,10 @@ endif()
add_compiler_rt_component(asan)
if(APPLE)
+ add_weak_symbols("asan" WEAK_SYMBOL_LINKFLAGS)
+ add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS)
+ add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS)
+
add_compiler_rt_runtime(clang_rt.asan
SHARED
OS ${SANITIZER_COMMON_SUPPORTED_OS}
@@ -117,6 +121,7 @@ if(APPLE)
RTLSanCommon
RTUbsan
CFLAGS ${ASAN_DYNAMIC_CFLAGS}
+ LINKFLAGS ${WEAK_SYMBOL_LINKFLAGS}
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
PARENT_TARGET asan)
else()
OpenPOWER on IntegriCloud