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 /cmake | |
parent | ef37b0fd2204e36bbf5dd46472a0e2d9e198ab1d (diff) |
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 'cmake')
-rw-r--r-- | cmake/config-ix.cmake | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 43d0f9555..493fdf479 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -164,7 +164,15 @@ set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${PPC64} ${S390X}) set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) -set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64}) + +# Darwin does not support 32-bit thread-local storage on ios versions +# below 9.0. Until the min ios version is bumped to 9.0, lsan will +# not build for 32-bit darwin targets. +if(APPLE) + set(ALL_LSAN_SUPPORTED_ARCH ${X86_64} ${ARM64}) +else() + set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64}) +endif() set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64}) set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64} ${MIPS32} ${MIPS64} ${S390X}) @@ -477,6 +485,13 @@ else() set(COMPILER_RT_HAS_LSAN FALSE) endif() +if(APPLE) + option(COMPILER_RT_ENABLE_LSAN_OSX "Enable building LSan for OS X - Experimental" Off) + if(COMPILER_RT_ENABLE_LSAN_OSX) + set(COMPILER_RT_HAS_LSAN TRUE) + endif() +endif() + if (COMPILER_RT_HAS_SANITIZER_COMMON AND MSAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux") set(COMPILER_RT_HAS_MSAN TRUE) |