Skip to content

Commit 4a13f09

Browse files
authored
Revert "[compiler-rt][test] Apply CFLAGS from sanitizer_common to all tests" (#152177)
Reverts #120798 because it caused an AddressSanitizer test breakage in global-overflow-bfd.cpp: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8707434189452310849/overview
1 parent 406f61f commit 4a13f09

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

compiler-rt/cmake/config-ix.cmake

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,6 @@ macro(get_test_cc_for_arch arch cc_out cflags_out)
309309
endif()
310310
string(REPLACE ";" " " ${cflags_out} "${${cflags_out}}")
311311
endif()
312-
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ANDROID)
313-
# ARM on Linux might use the slow unwinder as default and the unwind table
314-
# is required to get a complete stacktrace.
315-
string(APPEND ${cflags_out} " -funwind-tables")
316-
if(CMAKE_SYSROOT)
317-
string(APPEND ${cflags_out} " --sysroot=${CMAKE_SYSROOT}")
318-
endif()
319-
endif()
320312
endmacro()
321313

322314
# Returns CFLAGS that should be used to run tests for the

compiler-rt/test/sanitizer_common/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ foreach(tool ${SUPPORTED_TOOLS})
7373
get_test_cc_for_arch(${arch} SANITIZER_COMMON_TEST_TARGET_CC SANITIZER_COMMON_TEST_TARGET_CFLAGS)
7474
set(CONFIG_NAME ${tool}-${arch}-${OS_NAME})
7575

76+
# ARM on Linux might use the slow unwinder as default and the unwind table is
77+
# required to get a complete stacktrace.
78+
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
79+
list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS -funwind-tables)
80+
if(CMAKE_SYSROOT)
81+
list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS "--sysroot=${CMAKE_SYSROOT}")
82+
endif()
83+
string(REPLACE ";" " " SANITIZER_COMMON_TEST_TARGET_CFLAGS
84+
"${SANITIZER_COMMON_TEST_TARGET_CFLAGS}")
85+
endif()
86+
7687
configure_lit_site_cfg(
7788
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
7889
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)

0 commit comments

Comments
 (0)