[compiler-rt] r259519 - Revert r259512 - [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 08:05:52 PST 2016


Author: dsanders
Date: Tue Feb  2 10:05:52 2016
New Revision: 259519

URL: http://llvm.org/viewvc/llvm-project?rev=259519&view=rev
Log:
Revert r259512 - [tsan] Add a libc++ and lit testsuite for each ${TSAN_SUPPORTED_ARCH}.

check-tsan does not pick up the correct libc++.so. It succeeded on my machine
by picking up the libc++.so that was built before making this change.


Modified:
    compiler-rt/trunk/lib/tsan/CMakeLists.txt
    compiler-rt/trunk/test/tsan/CMakeLists.txt
    compiler-rt/trunk/test/tsan/lit.cfg
    compiler-rt/trunk/test/tsan/lit.site.cfg.in

Modified: compiler-rt/trunk/lib/tsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/CMakeLists.txt?rev=259519&r1=259518&r2=259519&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/CMakeLists.txt Tue Feb  2 10:05:52 2016
@@ -204,17 +204,10 @@ endif()
 # Build libcxx instrumented with TSan.
 if(COMPILER_RT_HAS_LIBCXX_SOURCES AND
    COMPILER_RT_TEST_COMPILER_ID STREQUAL "Clang")
-  set(libcxx_tsan_deps)
-  foreach(arch ${TSAN_SUPPORTED_ARCH})
-    get_target_flags_for_arch(${arch} TARGET_CFLAGS)
-    set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan_${arch})
-    add_custom_libcxx(libcxx_tsan_${arch} ${LIBCXX_PREFIX}
-      DEPS ${TSAN_RUNTIME_LIBRARIES}
-      CFLAGS ${TARGET_CFLAGS} -fsanitize=thread)
-    list(APPEND libcxx_tsan_deps libcxx_tsan_${arch})
-  endforeach()
-
-  add_custom_target(libcxx_tsan DEPENDS ${libcxx_tsan_deps})
+  set(LIBCXX_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libcxx_tsan)
+  add_custom_libcxx(libcxx_tsan ${LIBCXX_PREFIX}
+    DEPS ${TSAN_RUNTIME_LIBRARIES}
+    CFLAGS -fsanitize=thread)
 endif()
 
 if(COMPILER_RT_INCLUDE_TESTS)

Modified: compiler-rt/trunk/test/tsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/CMakeLists.txt?rev=259519&r1=259518&r2=259519&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/tsan/CMakeLists.txt Tue Feb  2 10:05:52 2016
@@ -14,28 +14,9 @@ else()
   set(TSAN_HAS_LIBCXX False)
 endif()
 
-set(TSAN_TESTSUITES)
-
-foreach(arch ${TSAN_SUPPORTED_ARCH})
-  string(TOLOWER "-${arch}" TSAN_TEST_CONFIG_SUFFIX)
-  if(ANDROID OR ${arch} MATCHES "arm|aarch64")
-    # This is only true if we are cross-compiling.
-    # Build all tests with host compiler and use host tools.
-    set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
-    set(TSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS})
-  else()
-    get_target_flags_for_arch(${arch} TSAN_TEST_TARGET_CFLAGS)
-    string(REPLACE ";" " " TSAN_TEST_TARGET_CFLAGS "${TSAN_TEST_TARGET_CFLAGS}")
-  endif()
-
-  string(TOUPPER ${arch} ARCH_UPPER_CASE)
-  set(CONFIG_NAME ${ARCH_UPPER_CASE}Config)
-
-  configure_lit_site_cfg(
-    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
-    ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg)
-  list(APPEND TSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
-endforeach()
+configure_lit_site_cfg(
+  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
 
 if(COMPILER_RT_INCLUDE_TESTS)
   configure_lit_site_cfg(
@@ -45,6 +26,6 @@ if(COMPILER_RT_INCLUDE_TESTS)
 endif()
 
 add_lit_testsuite(check-tsan "Running ThreadSanitizer tests"
-  ${TSAN_TESTSUITES}
+  ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${TSAN_TEST_DEPS})
 set_target_properties(check-tsan PROPERTIES FOLDER "TSan tests")

Modified: compiler-rt/trunk/test/tsan/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/lit.cfg?rev=259519&r1=259518&r2=259519&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/lit.cfg (original)
+++ compiler-rt/trunk/test/tsan/lit.cfg Tue Feb  2 10:05:52 2016
@@ -12,7 +12,7 @@ def get_required_attr(config, attr_name)
   return attr_value
 
 # Setup config name.
-config.name = 'ThreadSanitizer' + config.name_suffix
+config.name = 'ThreadSanitizer'
 
 # Setup source root.
 config.test_source_root = os.path.dirname(__file__)
@@ -39,11 +39,9 @@ else:
   extra_cflags = []
 
 # Setup default compiler flags used with -fsanitize=thread option.
-clang_tsan_cflags = (["-fsanitize=thread",
-                      "-Wall"] +
-                      [config.target_cflags] +
-                      config.debug_info_flags +
-                      extra_cflags)
+clang_tsan_cflags = ["-fsanitize=thread",
+                     "-Wall",
+                     "-m64"] + config.debug_info_flags + extra_cflags
 clang_tsan_cxxflags = config.cxx_mode_flags + clang_tsan_cflags
 # Add additional flags if we're using instrumented libc++.
 # Instrumented libcxx currently not supported on Darwin.

Modified: compiler-rt/trunk/test/tsan/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/lit.site.cfg.in?rev=259519&r1=259518&r2=259519&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/lit.site.cfg.in (original)
+++ compiler-rt/trunk/test/tsan/lit.site.cfg.in Tue Feb  2 10:05:52 2016
@@ -1,9 +1,7 @@
 ## Autogenerated by LLVM/Clang configuration.
 # Do not edit!
 
-config.name_suffix = "@TSAN_TEST_CONFIG_SUFFIX@"
 config.has_libcxx = @TSAN_HAS_LIBCXX@
-config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@"
 
 # Load common config for all compiler-rt lit tests.
 lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")




More information about the llvm-commits mailing list