diff options
author | Francis Ricci <francisjricci@gmail.com> | 2017-02-14 00:56:53 +0000 |
---|---|---|
committer | Francis Ricci <francisjricci@gmail.com> | 2017-02-14 00:56:53 +0000 |
commit | c57f0f5eb0d862ba58aebf682a32502a2706cbba (patch) | |
tree | 8f1673023a35e181b46eb5cc5380020f41543dd8 /lib/asan/CMakeLists.txt | |
parent | ef37b0fd2204e36bbf5dd46472a0e2d9e198ab1d (diff) | |
download | compiler-rt-c57f0f5eb0d862ba58aebf682a32502a2706cbba.tar.gz |
Add cmake build support for lsan on OS X
Summary:
Adds a new cmake flag 'COMPILER_RT_ENABLE_LSAN_OSX', which enables lsan
compilation and is turned off by default. Patches to fix build errors
when this flag is enabled will be uploaded soon.
This is part of an effort to port LSan to OS X, but LSan on OS X does not
currently work or pass tests currently.
Reviewers: kubamracek, kcc, glider, alekseyshl
Reviewed By: kubamracek
Subscribers: danalbert, srhines, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D29783
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/CMakeLists.txt')
-rw-r--r-- | lib/asan/CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt index 78a504cfa..e940cc756 100644 --- a/lib/asan/CMakeLists.txt +++ b/lib/asan/CMakeLists.txt @@ -36,6 +36,11 @@ set(ASAN_PREINIT_SOURCES include_directories(..) set(ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) + +# FIXME(fjricci) - remove this once lsan for darwin is fully enabled +if(APPLE AND COMPILER_RT_HAS_LSAN) + set(ASAN_CFLAGS ${ASAN_CFLAGS} -DCAN_SANITIZE_LEAKS_MAC=1) +endif() append_rtti_flag(OFF ASAN_CFLAGS) set(ASAN_DYNAMIC_LINK_FLAGS) @@ -107,6 +112,7 @@ add_compiler_rt_component(asan) if(APPLE) add_weak_symbols("asan" WEAK_SYMBOL_LINK_FLAGS) + add_weak_symbols("lsan" WEAK_SYMBOL_LINK_FLAGS) add_weak_symbols("ubsan" WEAK_SYMBOL_LINK_FLAGS) add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS) |