Skip to content

Commit 83b012a

Browse files
committed
[compiler-rt] Propagate sysroot from CMake to msan tests
Some msan tests requires rpc/xdr.h, which is no longer available in some newer glibc. In build systems with hermetic sysroot set through CMake, this issue can be solved by setting the sysroot to CMAKE_SYSROOT for these tests. This patch implements it.
1 parent 460c0f5 commit 83b012a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

compiler-rt/test/msan/lit.cfg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"-fno-optimize-sibling-calls",
1818
]
1919
+ [config.target_cflags]
20-
+ config.debug_info_flags
20+
+ ["--sysroot", config.cmake_sysroot]
21+
if config.cmake_sysroot and config.host_os == "Linux"
22+
else [] + config.debug_info_flags
2123
)
2224
# Some Msan tests leverage backtrace() which requires libexecinfo on FreeBSD.
2325
if config.host_os == "FreeBSD":

compiler-rt/test/msan/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config.target_cflags = "@MSAN_TEST_TARGET_CFLAGS@"
66
config.target_arch = "@MSAN_TEST_TARGET_ARCH@"
77
config.use_lld = @MSAN_TEST_USE_LLD@
88
config.use_thinlto = @MSAN_TEST_USE_THINLTO@
9+
config.cmake_sysroot = "@CMAKE_SYSROOT@"
910

1011
# Load common config for all compiler-rt lit tests.
1112
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")

0 commit comments

Comments
 (0)