summaryrefslogtreecommitdiff
path: root/lib/msan/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-05-09 22:11:03 +0000
committerAlexey Samsonov <samsonov@google.com>2014-05-09 22:11:03 +0000
commit2e8e44123a1af21beacf1190fc9f9c8104088c5f (patch)
treef695eb3804dbd01b18db183bb7ffe705e86065ac /lib/msan/CMakeLists.txt
parent37ad976ebf0b192db2c7d5f23c404d4e0dede625 (diff)
[CMake] Use ExternalProject to build MSan-ified version of libcxx for unit tests.
This change lets MSan rely on libcxx's own build system instead of manually compiling its sources and setting up all the necessary compile flags. It would also simplify compiling libcxx with another sanitizers (in particular, TSan). The tricky part is to make sure libcxx is reconfigured/rebuilt when Clang or MSan runtime library is changed. "clobber" step used in this patch works well for me, but it's possible it would break for other configurations - will watch the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/CMakeLists.txt')
-rw-r--r--lib/msan/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/msan/CMakeLists.txt b/lib/msan/CMakeLists.txt
index a05d324fd..e046a7729 100644
--- a/lib/msan/CMakeLists.txt
+++ b/lib/msan/CMakeLists.txt
@@ -17,6 +17,8 @@ append_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS)
# Prevent clang from generating libc calls.
append_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding MSAN_RTL_CFLAGS)
+set(MSAN_RUNTIME_LIBRARIES)
+
# Static runtime library.
add_custom_target(msan)
set(arch "x86_64")
@@ -28,6 +30,7 @@ if(CAN_TARGET_${arch})
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
CFLAGS ${MSAN_RTL_CFLAGS})
add_dependencies(msan clang_rt.msan-${arch})
+ list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch})
if(UNIX)
add_sanitizer_rt_symbols(clang_rt.msan-${arch} msan.syms.extra)
add_dependencies(msan clang_rt.msan-${arch}-symbols)