Fix lld detection in standalone compiler-rt.
Summary: Right now all hwasan tests on Android are silently disabled because they require "has_lld" and standalone compiler-rt can not (and AFAIK was never able to) set it. Reviewers: pcc Subscribers: dberris, mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69405
This commit is contained in:
parent
55c223a7ed
commit
a1817996fa
|
@ -497,7 +497,7 @@ else()
|
|||
if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD)
|
||||
set(COMPILER_RT_HAS_LLD TRUE)
|
||||
else()
|
||||
set(COMPILER_RT_HAS_LLD FALSE)
|
||||
set(COMPILER_RT_HAS_LLD ${COMPILER_RT_HAS_FUSE_LD_LLD_FLAG})
|
||||
endif()
|
||||
endif()
|
||||
pythonize_bool(COMPILER_RT_HAS_LLD)
|
||||
|
|
|
@ -146,6 +146,7 @@ check_library_exists(stdc++ __cxa_throw "" COMPILER_RT_HAS_LIBSTDCXX)
|
|||
|
||||
# Linker flags.
|
||||
check_linker_flag("-Wl,-z,text" COMPILER_RT_HAS_Z_TEXT)
|
||||
check_linker_flag("-fuse-ld=lld" COMPILER_RT_HAS_FUSE_LD_LLD_FLAG)
|
||||
|
||||
if(ANDROID)
|
||||
check_linker_flag("-Wl,-z,global" COMPILER_RT_HAS_Z_GLOBAL)
|
||||
|
|
|
@ -24,9 +24,11 @@ set(HWASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
|
|||
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
||||
list(APPEND HWASAN_TEST_DEPS hwasan)
|
||||
if(COMPILER_RT_HAS_LLD)
|
||||
if (TARGET lld)
|
||||
list(APPEND HWASAN_TEST_DEPS lld)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_lit_testsuite(check-hwasan "Running the HWAddressSanitizer tests"
|
||||
${HWASAN_TESTSUITES}
|
||||
|
|
|
@ -20,8 +20,10 @@ macro(add_msan_testsuite arch lld thinlto)
|
|||
endif()
|
||||
if (${lld})
|
||||
set(CONFIG_NAME "lld-${CONFIG_NAME}")
|
||||
if (TARGET lld)
|
||||
list(APPEND MSAN_TEST_DEPS lld)
|
||||
endif()
|
||||
endif()
|
||||
set(MSAN_TEST_USE_THINLTO ${thinlto})
|
||||
set(MSAN_TEST_USE_LLD ${lld})
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ macro(add_ubsan_testsuite test_mode sanitizer arch lld thinlto)
|
|||
set(CONFIG_NAME ${UBSAN_LIT_TEST_MODE})
|
||||
if (${lld})
|
||||
set(CONFIG_NAME ${CONFIG_NAME}-lld)
|
||||
if (TARGET lld)
|
||||
list(APPEND UBSAN_TEST_DEPS lld)
|
||||
endif()
|
||||
endif()
|
||||
if (${thinlto})
|
||||
set(CONFIG_NAME ${CONFIG_NAME}-thinlto)
|
||||
list(APPEND UBSAN_TEST_DEPS LTO)
|
||||
|
|
Loading…
Reference in New Issue