summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-06-18 03:39:51 +0000
committerJustin Bogner <mail@justinbogner.com>2015-06-18 03:39:51 +0000
commit66afb72e2a4965fa9f72a8d7abdd5e359c91ee06 (patch)
tree8c3eb7c423cc3c562a10985f1d0f3bc6680e0f05
parenta941129d006e41d9f59e81d7f2fef631766a4464 (diff)
downloadbcm5719-llvm-66afb72e2a4965fa9f72a8d7abdd5e359c91ee06.tar.gz
bcm5719-llvm-66afb72e2a4965fa9f72a8d7abdd5e359c91ee06.zip
Revert "[CMake] LSan is not actually available on Darwin."
This change makes cmake fail to even run on Darwin with errors evaluating "$<TARGET_OBJECTS:RTInterception.x86_64>". This reverts r239955 llvm-svn: 239985
-rw-r--r--compiler-rt/cmake/config-ix.cmake2
-rw-r--r--compiler-rt/lib/lsan/CMakeLists.txt22
-rw-r--r--compiler-rt/test/lsan/CMakeLists.txt18
3 files changed, 23 insertions, 19 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index b6fe8ffb08c..bfc8497c4d8 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -295,7 +295,7 @@ else()
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND LSAN_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Linux|FreeBSD")
+ OS_NAME MATCHES "Darwin|Linux|FreeBSD")
set(COMPILER_RT_HAS_LSAN TRUE)
else()
set(COMPILER_RT_HAS_LSAN FALSE)
diff --git a/compiler-rt/lib/lsan/CMakeLists.txt b/compiler-rt/lib/lsan/CMakeLists.txt
index eb5fe28d062..d87e9ddb8a2 100644
--- a/compiler-rt/lib/lsan/CMakeLists.txt
+++ b/compiler-rt/lib/lsan/CMakeLists.txt
@@ -24,15 +24,17 @@ add_compiler_rt_object_libraries(RTLSanCommon
SOURCES ${LSAN_COMMON_SOURCES}
CFLAGS ${LSAN_CFLAGS})
-foreach(arch ${LSAN_SUPPORTED_ARCH})
- add_compiler_rt_runtime(clang_rt.lsan-${arch} ${arch} STATIC
- SOURCES ${LSAN_SOURCES}
- $<TARGET_OBJECTS:RTInterception.${arch}>
- $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
- $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
- $<TARGET_OBJECTS:RTLSanCommon.${arch}>
- CFLAGS ${LSAN_CFLAGS})
- add_dependencies(lsan clang_rt.lsan-${arch})
-endforeach()
+if(NOT APPLE)
+ foreach(arch ${LSAN_SUPPORTED_ARCH})
+ add_compiler_rt_runtime(clang_rt.lsan-${arch} ${arch} STATIC
+ SOURCES ${LSAN_SOURCES}
+ $<TARGET_OBJECTS:RTInterception.${arch}>
+ $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+ $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
+ $<TARGET_OBJECTS:RTLSanCommon.${arch}>
+ CFLAGS ${LSAN_CFLAGS})
+ add_dependencies(lsan clang_rt.lsan-${arch})
+ endforeach()
+endif()
add_dependencies(compiler-rt lsan)
diff --git a/compiler-rt/test/lsan/CMakeLists.txt b/compiler-rt/test/lsan/CMakeLists.txt
index 6cca00a90b6..7f49b0d3983 100644
--- a/compiler-rt/test/lsan/CMakeLists.txt
+++ b/compiler-rt/test/lsan/CMakeLists.txt
@@ -10,12 +10,14 @@ configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/AsanConfig/lit.site.cfg)
-set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
-if(NOT COMPILER_RT_STANDALONE_BUILD)
- list(APPEND LSAN_TEST_DEPS lsan asan)
+if(NOT APPLE AND NOT ANDROID)
+ set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
+ if(NOT COMPILER_RT_STANDALONE_BUILD)
+ list(APPEND LSAN_TEST_DEPS lsan asan)
+ endif()
+ add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
+ ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig
+ ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig
+ DEPENDS ${LSAN_TEST_DEPS})
+ set_target_properties(check-lsan PROPERTIES FOLDER "LSan tests")
endif()
-add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
- ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig
- ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig
- DEPENDS ${LSAN_TEST_DEPS})
-set_target_properties(check-lsan PROPERTIES FOLDER "LSan tests")
OpenPOWER on IntegriCloud