Skip to content

[compiler-rt][test] Apply CFLAGS from sanitizer_common to all tests #120798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions compiler-rt/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,14 @@ macro(get_test_cc_for_arch arch cc_out cflags_out)
endif()
string(REPLACE ";" " " ${cflags_out} "${${cflags_out}}")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ANDROID)
# ARM on Linux might use the slow unwinder as default and the unwind table
# is required to get a complete stacktrace.
string(APPEND ${cflags_out} " -funwind-tables")
if(CMAKE_SYSROOT)
string(APPEND ${cflags_out} " --sysroot=${CMAKE_SYSROOT}")
endif()
endif()
endmacro()

# Returns CFLAGS that should be used to run tests for the
Expand Down
11 changes: 0 additions & 11 deletions compiler-rt/test/sanitizer_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,6 @@ foreach(tool ${SUPPORTED_TOOLS})
get_test_cc_for_arch(${arch} SANITIZER_COMMON_TEST_TARGET_CC SANITIZER_COMMON_TEST_TARGET_CFLAGS)
set(CONFIG_NAME ${tool}-${arch}-${OS_NAME})

# ARM on Linux might use the slow unwinder as default and the unwind table is
# required to get a complete stacktrace.
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS -funwind-tables)
if(CMAKE_SYSROOT)
list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS "--sysroot=${CMAKE_SYSROOT}")
endif()
string(REPLACE ";" " " SANITIZER_COMMON_TEST_TARGET_CFLAGS
"${SANITIZER_COMMON_TEST_TARGET_CFLAGS}")
endif()

configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
Expand Down
Loading