Skip to content

Commit 5c8a61c

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 5c8a61c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"-fno-optimize-sibling-calls",
1818
]
1919
+ [config.target_cflags]
20+
+ [
21+
"--sysroot",
22+
config.cmake_sysroot
23+
] if config.cmake_sysroot and config.host_os == "Linux" else []
2024
+ config.debug_info_flags
2125
)
2226
# Some Msan tests leverage backtrace() which requires libexecinfo on 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)