[compiler-rt] r243785 - [CMake] Don't build libc++ with MSan-with-calls instrumentation.

Alexey Samsonov vonosmas at gmail.com
Fri Jul 31 14:15:35 PDT 2015


Author: samsonov
Date: Fri Jul 31 16:15:34 2015
New Revision: 243785

URL: http://llvm.org/viewvc/llvm-project?rev=243785&view=rev
Log:
[CMake] Don't build libc++ with MSan-with-calls instrumentation.

Instead, refactor the build rules so that we build libc++ with MSan for
each supported architecture.

Modified:
    compiler-rt/trunk/lib/msan/tests/CMakeLists.txt

Modified: compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/CMakeLists.txt?rev=243785&r1=243784&r2=243785&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/tests/CMakeLists.txt Fri Jul 31 16:15:34 2015
@@ -90,12 +90,6 @@ set_target_properties(MsanUnitTests PROP
 
 # Adds MSan unit tests and benchmarks for architecture.
 macro(add_msan_tests_for_arch arch kind)
-  set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/../libcxx_msan${kind})
-  add_custom_libcxx(libcxx_msan${kind} ${LIBCXX_PREFIX}
-    DEPS ${MSAN_RUNTIME_LIBRARIES}
-    CFLAGS ${MSAN_LIBCXX_CFLAGS} ${ARGN})
-  set(MSAN_LIBCXX_SO ${LIBCXX_PREFIX}/lib/libc++.so)
-
   # Build gtest instrumented with MSan.
   set(MSAN_INST_GTEST)
   msan_compile(MSAN_INST_GTEST ${COMPILER_RT_GTEST_SOURCE} ${arch} "${kind}"
@@ -120,24 +114,31 @@ macro(add_msan_tests_for_arch arch kind)
                    DEPS ${MSAN_INST_LOADABLE_OBJECTS})
 
   set(MSAN_TEST_OBJECTS ${MSAN_INST_TEST_OBJECTS} ${MSAN_INST_GTEST})
-  set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan${kind}
+  set(MSAN_TEST_DEPS ${MSAN_TEST_OBJECTS} libcxx_msan_${arch}
                      ${MSAN_LOADABLE_SO})
   if(NOT COMPILER_RT_STANDALONE_BUILD)
     list(APPEND MSAN_TEST_DEPS msan)
   endif()
   get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
   add_compiler_rt_test(MsanUnitTests "Msan-${arch}${kind}-Test" ${arch}
-	  OBJECTS ${MSAN_TEST_OBJECTS} ${MSAN_LIBCXX_SO}
-	  DEPS ${MSAN_TEST_DEPS}
-	  LINK_FLAGS ${MSAN_UNITTEST_LINK_FLAGS}
-                     ${TARGET_LINK_FLAGS}
-                     "-Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}"
-                     "-Wl,-rpath=${LIBCXX_PREFIX}/lib")
+    OBJECTS ${MSAN_TEST_OBJECTS} ${MSAN_LIBCXX_SO}
+    DEPS ${MSAN_TEST_DEPS}
+    LINK_FLAGS ${MSAN_UNITTEST_LINK_FLAGS}
+               ${TARGET_LINK_FLAGS}
+               "-Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}"
+               "-Wl,-rpath=${LIBCXX_PREFIX}/lib")
 endmacro()
 
 # We should only build MSan unit tests if we can build instrumented libcxx.
 if(COMPILER_RT_CAN_EXECUTE_TESTS AND COMPILER_RT_HAS_LIBCXX_SOURCES)
   foreach(arch ${MSAN_SUPPORTED_ARCH})
+    get_target_flags_for_arch(${arch} TARGET_CFLAGS)
+    set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/../libcxx_msan_${arch})
+    add_custom_libcxx(libcxx_msan_${arch} ${LIBCXX_PREFIX}
+      DEPS ${MSAN_RUNTIME_LIBRARIES}
+      CFLAGS ${MSAN_LIBCXX_CFLAGS} ${TARGET_CFLAGS})
+    set(MSAN_LIBCXX_SO ${LIBCXX_PREFIX}/lib/libc++.so)
+
     add_msan_tests_for_arch(${arch} "")
     add_msan_tests_for_arch(${arch} "-with-call"
                             -mllvm -msan-instrumentation-with-call-threshold=0)





More information about the llvm-commits mailing list