[llvm-branch-commits] [compiler-rt] 32f0877 - [compiler-rt][test] Propagate CMAKE_SYSROOT to all Linux tests (#241085)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 11 01:51:46 PST 2026


Author: Vitaly Buka
Date: 2026-11-11T02:31:56Z
New Revision: 32f08773fb7423507465ac4d1eeb280fd894f2a2

URL: https://github.com/llvm/llvm-project/commit/32f08773fb7423507465ac4d1eeb280fd894f2a2
DIFF: https://github.com/llvm/llvm-project/commit/32f08773fb7423507465ac4d1eeb280fd894f2a2.diff

LOG: [compiler-rt][test] Propagate CMAKE_SYSROOT to all Linux tests (#241085)

Reverts llvm/llvm-project#240790
(7ef93748feaebefe516af5ebdee432a820ca37f5) and relands
llvm/llvm-project#239742 (97218874e828e38eac17c5ecef78ef962fae0342) /
llvm/llvm-project#120798 by @aaronpuchert.

Keep `-funwind-tables` in `sanitizer_common` and only move
`--sysroot=${CMAKE_SYSROOT}` to `get_test_cc_for_arch`, fixing
`Builtins-armhf-linux` (`-nodefaultlibs` without `libunwind`) link
failures on
https://lab.llvm.org/buildbot/#/builders/clang-armv8-lld-2stage.

Co-authored-by: Aaron Puchert <aaron.puchert at sap.com>
Assisted-by: Gemini

Added: 
    

Modified: 
    compiler-rt/cmake/config-ix.cmake
    compiler-rt/test/sanitizer_common/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index 8b883d7c4a580e..940a52fbe05339 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -322,6 +322,9 @@ 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 AND CMAKE_SYSROOT)
+    string(APPEND ${cflags_out} " --sysroot=${CMAKE_SYSROOT}")
+  endif()
 endmacro()
 
 # Returns CFLAGS that should be used to run tests for the

diff  --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt
index 739879d961248b..762124288e0178 100644
--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt
+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt
@@ -75,9 +75,6 @@ foreach(tool ${SUPPORTED_TOOLS})
     # 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()


        


More information about the llvm-branch-commits mailing list