diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2017-12-01 10:09:27 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2017-12-01 10:09:27 +0000 |
commit | 1cddf5ff40f0ddde780c4e0af22f87bf9ef12b11 (patch) | |
tree | e129cc46404c5b826e3c2eff602207ce4e3daa02 /test | |
parent | 9f5847984a6b837659968320e6d624a2ff94f609 (diff) |
Revert "[ubsan] lit changes for lld testing, future lto testing."
This reverts commit r319525.
This change has introduced a problem with the Lit tests build for compiler-rt using Gold: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/6047/steps/test%20standalone%20compiler-rt/logs/stdio
llvm-lit: /b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py:101: fatal: unable to parse config file '/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg', traceback: Traceback (most recent call last):
File "/b/sanitizer-x86_64-linux/build/llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path
exec(compile(data, path, 'exec'), cfg_globals, None)
File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 37, in <module>
if root.host_os not in ['Linux'] or not is_gold_linker_available():
File "/b/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/test/profile/Linux/lit.local.cfg", line 27, in is_gold_linker_available
stderr = subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319529 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/asan/lit.cfg | 2 | ||||
-rw-r--r-- | test/cfi/lit.cfg | 9 | ||||
-rw-r--r-- | test/cfi/lit.site.cfg.in | 1 | ||||
-rw-r--r-- | test/lit.common.cfg | 19 | ||||
-rw-r--r-- | test/lit.common.configured.in | 1 | ||||
-rw-r--r-- | test/sanitizer_common/lit.common.cfg | 2 | ||||
-rw-r--r-- | test/scudo/lit.cfg | 2 | ||||
-rw-r--r-- | test/tsan/lit.cfg | 2 | ||||
-rw-r--r-- | test/ubsan/CMakeLists.txt | 33 | ||||
-rw-r--r-- | test/ubsan/lit.common.cfg | 10 | ||||
-rw-r--r-- | test/ubsan/lit.site.cfg.in | 3 | ||||
-rw-r--r-- | test/ubsan_minimal/lit.common.cfg | 2 |
12 files changed, 21 insertions, 65 deletions
diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg index 4a08a7b47..6a4044a44 100644 --- a/test/asan/lit.cfg +++ b/test/asan/lit.cfg @@ -96,7 +96,7 @@ if platform.system() == 'Windows': config.available_features.add(win_runtime_feature) def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " + return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " " config.substitutions.append( ("%clang ", build_invocation(target_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) ) diff --git a/test/cfi/lit.cfg b/test/cfi/lit.cfg index cbffe6ea8..7dae9a0d5 100644 --- a/test/cfi/lit.cfg +++ b/test/cfi/lit.cfg @@ -5,16 +5,13 @@ config.name = 'cfi' + config.name_suffix config.suffixes = ['.c', '.cpp', '.test'] config.test_source_root = os.path.dirname(__file__) -def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " - -clang = build_invocation([config.target_cflags]) -clangxx = build_invocation([config.target_cflags] + config.cxx_mode_flags) +clang = ' '.join([config.compile_wrapper, config.clang, config.target_cflags]) +clangxx = ' '.join([config.compile_wrapper, config.clang, config.target_cflags] + config.cxx_mode_flags) config.substitutions.append((r"%clang ", clang + ' ')) config.substitutions.append((r"%clangxx ", clangxx + ' ')) if config.lto_supported: - clang_cfi = clang + '-fsanitize=cfi ' + clang_cfi = ' '.join(config.lto_launch + [clang] + config.lto_flags + ['-fsanitize=cfi ']) if config.cfi_lit_test_mode == "Devirt": config.available_features.add('devirt') diff --git a/test/cfi/lit.site.cfg.in b/test/cfi/lit.site.cfg.in index eb9b44137..066c915ef 100644 --- a/test/cfi/lit.site.cfg.in +++ b/test/cfi/lit.site.cfg.in @@ -5,7 +5,6 @@ config.cfi_lit_test_mode = "@CFI_LIT_TEST_MODE@" config.target_arch = "@CFI_TEST_TARGET_ARCH@" config.target_cflags = "@CFI_TEST_TARGET_CFLAGS@" config.use_lld = @CFI_TEST_USE_LLD@ -config.use_lto = True # CFI *requires* LTO. config.use_thinlto = @CFI_TEST_USE_THINLTO@ lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") diff --git a/test/lit.common.cfg b/test/lit.common.cfg index 0840f65a7..56d4fef4e 100644 --- a/test/lit.common.cfg +++ b/test/lit.common.cfg @@ -324,22 +324,3 @@ if config.asan_shadow_scale: config.available_features.add("shadow-scale-%s" % config.asan_shadow_scale) else: config.available_features.add("shadow-scale-3") - -# Propagate the LLD/LTO into the clang config option, so nothing else is needed. -run_wrapper = [] -target_cflags = [getattr(config, 'target_cflags', None)] -extra_cflags = [] - -if config.use_lto and config.lto_supported: - run_wrapper += config.lto_launch - extra_cflags += config.lto_flags -elif config.use_lto and (not config.lto_supported): - config.unsupported = True - -if config.use_lld and config.has_lld and not config.use_lto: - extra_cflags += ["-fuse-ld=lld"] -elif config.use_lld and (not config.has_lld): - config.unsupported = True - -config.clang = " " + " ".join(run_wrapper + [config.compile_wrapper, config.clang]) + " " -config.target_cflags = " " + " ".join(target_cflags + extra_cflags) + " " diff --git a/test/lit.common.configured.in b/test/lit.common.configured.in index 32a88200b..e2da4cc9b 100644 --- a/test/lit.common.configured.in +++ b/test/lit.common.configured.in @@ -33,7 +33,6 @@ set_default("has_lld", @COMPILER_RT_HAS_LLD_PYBOOL@) set_default("can_symbolize", @CAN_SYMBOLIZE@) set_default("use_lld", False) set_default("use_thinlto", False) -set_default("use_lto", config.use_thinlto) set_default("android", @ANDROID_PYBOOL@) config.available_features.add('target-is-%s' % config.target_arch) diff --git a/test/sanitizer_common/lit.common.cfg b/test/sanitizer_common/lit.common.cfg index c7a1682f7..a4a5d4e85 100644 --- a/test/sanitizer_common/lit.common.cfg +++ b/test/sanitizer_common/lit.common.cfg @@ -48,7 +48,7 @@ clang_cflags = config.debug_info_flags + tool_cflags + [config.target_cflags] clang_cxxflags = config.cxx_mode_flags + clang_cflags def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " + return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " " config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) ) config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) ) diff --git a/test/scudo/lit.cfg b/test/scudo/lit.cfg index 028bf721b..2f6469d25 100644 --- a/test/scudo/lit.cfg +++ b/test/scudo/lit.cfg @@ -36,7 +36,7 @@ if not config.android: cxx_flags = (c_flags + config.cxx_mode_flags + ["-std=c++11"]) def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " + return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " " # Add clang substitutions. config.substitutions.append(("%clang ", build_invocation(c_flags))) diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg index fdbafefbc..f0dc7b67e 100644 --- a/test/tsan/lit.cfg +++ b/test/tsan/lit.cfg @@ -66,7 +66,7 @@ if config.has_libcxx and config.host_os != 'Darwin': "-Wl,-rpath=%s" % libcxx_libdir] def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " + return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " " config.substitutions.append( ("%clang_tsan ", build_invocation(clang_tsan_cflags)) ) config.substitutions.append( ("%clangxx_tsan ", build_invocation(clang_tsan_cxxflags)) ) diff --git a/test/ubsan/CMakeLists.txt b/test/ubsan/CMakeLists.txt index 779168147..5843e0cb8 100644 --- a/test/ubsan/CMakeLists.txt +++ b/test/ubsan/CMakeLists.txt @@ -3,20 +3,9 @@ set(UBSAN_LIT_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(UBSAN_TESTSUITES) set(UBSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) -macro(add_ubsan_testsuite test_mode sanitizer arch lld thinlto) +macro(add_ubsan_testsuite test_mode sanitizer arch) set(UBSAN_LIT_TEST_MODE "${test_mode}") - set(CONFIG_NAME ${UBSAN_LIT_TEST_MODE}) - if (${lld}) - set(CONFIG_NAME ${CONFIG_NAME}-lld) - list(APPEND UBSAN_TEST_DEPS lld) - endif() - if (${thinlto}) - set(CONFIG_NAME ${CONFIG_NAME}-thinlto) - list(APPEND UBSAN_TEST_DEPS LTO) - endif() - set(UBSAN_TEST_USE_LLD ${lld}) - set(UBSAN_TEST_USE_THINLTO ${thinlto}) - set(CONFIG_NAME ${CONFIG_NAME}-${arch}) + set(CONFIG_NAME ${UBSAN_LIT_TEST_MODE}-${arch}) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) @@ -26,14 +15,6 @@ macro(add_ubsan_testsuite test_mode sanitizer arch lld thinlto) endif() endmacro() -macro(add_ubsan_testsuites test_mode sanitizer arch) - add_ubsan_testsuite(${test_mode} ${sanitizer} ${arch} False False) - - if(COMPILER_RT_HAS_LLD AND arch STREQUAL "x86_64" AND NOT (APPLE OR WIN32)) - add_ubsan_testsuite(${test_mode} ${sanitizer} ${arch} True False) - endif() -endmacro() - set(UBSAN_TEST_ARCH ${UBSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(UBSAN_SUPPORTED_ARCH UBSAN_TEST_ARCH) @@ -42,20 +23,20 @@ endif() foreach(arch ${UBSAN_TEST_ARCH}) set(UBSAN_TEST_TARGET_ARCH ${arch}) get_test_cc_for_arch(${arch} UBSAN_TEST_TARGET_CC UBSAN_TEST_TARGET_CFLAGS) - add_ubsan_testsuites("Standalone" ubsan ${arch}) + add_ubsan_testsuite("Standalone" ubsan ${arch}) if(COMPILER_RT_HAS_ASAN AND ";${ASAN_SUPPORTED_ARCH};" MATCHES ";${arch};") # TODO(wwchrome): Re-enable ubsan for asan win 64-bit when ready. # Disable ubsan with AddressSanitizer tests for Windows 64-bit. if(NOT OS_NAME MATCHES "Windows" OR CMAKE_SIZEOF_VOID_P EQUAL 4) - add_ubsan_testsuites("AddressSanitizer" asan ${arch}) + add_ubsan_testsuite("AddressSanitizer" asan ${arch}) endif() endif() if(COMPILER_RT_HAS_MSAN AND ";${MSAN_SUPPORTED_ARCH};" MATCHES ";${arch};") - add_ubsan_testsuites("MemorySanitizer" msan ${arch}) + add_ubsan_testsuite("MemorySanitizer" msan ${arch}) endif() if(COMPILER_RT_HAS_TSAN AND ";${TSAN_SUPPORTED_ARCH};" MATCHES ";${arch};" AND NOT ANDROID) - add_ubsan_testsuites("ThreadSanitizer" tsan ${arch}) + add_ubsan_testsuite("ThreadSanitizer" tsan ${arch}) endif() endforeach() @@ -64,7 +45,7 @@ if(APPLE) set(UBSAN_TEST_TARGET_ARCH ${arch}) get_test_cc_for_arch(${arch} UBSAN_TEST_TARGET_CC UBSAN_TEST_TARGET_CFLAGS) set(UBSAN_TEST_TARGET_CFLAGS "${UBSAN_TEST_TARGET_CFLAGS} -lc++abi") - add_ubsan_testsuites("StandaloneStatic" ubsan ${arch}) + add_ubsan_testsuite("StandaloneStatic" ubsan ${arch}) endforeach() endif() diff --git a/test/ubsan/lit.common.cfg b/test/ubsan/lit.common.cfg index 83475a2dc..e1bd349af 100644 --- a/test/ubsan/lit.common.cfg +++ b/test/ubsan/lit.common.cfg @@ -11,9 +11,6 @@ def get_required_attr(config, attr_name): "to lit.site.cfg " % attr_name) return attr_value -# Setup config name. -config.name = 'UBSan-' + config.name_suffix - # Setup source root. config.test_source_root = os.path.dirname(__file__) @@ -21,19 +18,24 @@ default_ubsan_opts = list(config.default_sanitizer_opts) # Choose between standalone and UBSan+ASan modes. ubsan_lit_test_mode = get_required_attr(config, 'ubsan_lit_test_mode') if ubsan_lit_test_mode == "Standalone": + config.name = 'UBSan-Standalone-' + config.target_arch config.available_features.add("ubsan-standalone") clang_ubsan_cflags = [] elif ubsan_lit_test_mode == "StandaloneStatic": + config.name = 'UBSan-StandaloneStatic-' + config.target_arch config.available_features.add("ubsan-standalone-static") clang_ubsan_cflags = ['-static-libsan'] elif ubsan_lit_test_mode == "AddressSanitizer": + config.name = 'UBSan-ASan-' + config.target_arch config.available_features.add("ubsan-asan") clang_ubsan_cflags = ["-fsanitize=address"] default_ubsan_opts += ['detect_leaks=0'] elif ubsan_lit_test_mode == "MemorySanitizer": + config.name = 'UBSan-MSan-' + config.target_arch config.available_features.add("ubsan-msan") clang_ubsan_cflags = ["-fsanitize=memory"] elif ubsan_lit_test_mode == "ThreadSanitizer": + config.name = 'UBSan-TSan-' + config.target_arch config.available_features.add("ubsan-tsan") clang_ubsan_cflags = ["-fsanitize=thread"] else: @@ -53,7 +55,7 @@ config.substitutions.append(('%env_ubsan_opts=', 'env UBSAN_OPTIONS=' + default_ubsan_opts_str)) def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " + return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " " target_cflags = [get_required_attr(config, "target_cflags")] clang_ubsan_cflags += target_cflags diff --git a/test/ubsan/lit.site.cfg.in b/test/ubsan/lit.site.cfg.in index a4d7b50ed..d8242163a 100644 --- a/test/ubsan/lit.site.cfg.in +++ b/test/ubsan/lit.site.cfg.in @@ -1,12 +1,9 @@ @LIT_SITE_CFG_IN_HEADER@ # Tool-specific config options. -config.name_suffix = "@CONFIG_NAME@" config.ubsan_lit_test_mode = "@UBSAN_LIT_TEST_MODE@" config.target_cflags = "@UBSAN_TEST_TARGET_CFLAGS@" config.target_arch = "@UBSAN_TEST_TARGET_ARCH@" -config.use_lld = @UBSAN_TEST_USE_LLD@ -config.use_thinlto = @UBSAN_TEST_USE_THINLTO@ # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured") diff --git a/test/ubsan_minimal/lit.common.cfg b/test/ubsan_minimal/lit.common.cfg index e8b42bb82..32a1d0b3e 100644 --- a/test/ubsan_minimal/lit.common.cfg +++ b/test/ubsan_minimal/lit.common.cfg @@ -16,7 +16,7 @@ config.test_source_root = os.path.dirname(__file__) config.name = 'UBSan-Minimal-' + config.target_arch def build_invocation(compile_flags): - return " " + " ".join([config.clang] + compile_flags) + " " + return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " " target_cflags = [get_required_attr(config, "target_cflags")] clang_ubsan_cflags = ["-fsanitize-minimal-runtime"] + target_cflags |