[compiler-rt] [XRay] Run tests inside bootstrapping build (PR #168378)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 07:21:17 PST 2025


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/168378

>From 944a5729ec24c58041b250d48a9785062f4b9052 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 17 Nov 2025 14:35:12 +0000
Subject: [PATCH 1/2] [XRay] Run tests inside bootstrapping build

COMPILER_RT_STANDALONE_BUILD is set when doing a bootstrapping build
through LLVM_ENABLE_RUNTIMES with the CMake source directory being in
llvm/. This patch changes the XRay tests to also detect that we have
LLVM sources and the llvm-xray tool if we are in a bootstrapping build
through the use of the LLVM_TREE_AVAILABLE variable which is set in
runtimes/CMakeLists.txt.
---
 compiler-rt/test/xray/lit.site.cfg.py.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/test/xray/lit.site.cfg.py.in b/compiler-rt/test/xray/lit.site.cfg.py.in
index 72a7be6a80e3a..4ed82beb6a2ab 100644
--- a/compiler-rt/test/xray/lit.site.cfg.py.in
+++ b/compiler-rt/test/xray/lit.site.cfg.py.in
@@ -5,7 +5,7 @@ config.name_suffix = "@XRAY_TEST_CONFIG_SUFFIX@"
 config.xray_lit_source_dir = "@XRAY_LIT_SOURCE_DIR@"
 config.target_cflags = "@XRAY_TEST_TARGET_CFLAGS@"
 config.target_arch = "@XRAY_TEST_TARGET_ARCH@"
-config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD@" != "TRUE")
+config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD AND NOT LLVM_TREE_AVAILABLE@" != "TRUE")
 
 # TODO: Look into whether we can run a capability test on the standalone build to
 # see whether it can run 'llvm-xray convert' instead of turning off tests for a

>From b614f37c941cc65b2ac51ead28de815d2a5bfe8a Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Tue, 18 Nov 2025 15:21:04 +0000
Subject: [PATCH 2/2] feedback

---
 compiler-rt/test/CMakeLists.txt          | 7 +++++++
 compiler-rt/test/xray/lit.site.cfg.py.in | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/compiler-rt/test/CMakeLists.txt b/compiler-rt/test/CMakeLists.txt
index a2e4c8cbf5685..9cfb7ea559475 100644
--- a/compiler-rt/test/CMakeLists.txt
+++ b/compiler-rt/test/CMakeLists.txt
@@ -16,6 +16,13 @@ pythonize_bool(COMPILER_RT_HAS_AARCH64_SME)
 
 pythonize_bool(COMPILER_RT_HAS_NO_DEFAULT_CONFIG_FLAG)
 
+if(LLVM_TREE_AVAILABLE OR NOT COMPILER_RT_STANDALONE_BUILD)
+  set(COMPILER_RT_BUILT_WITH_LLVM TRUE)
+else()
+  set(COMPILER_RT_BUILT_WITH_LLVM FALSE)
+endif()
+pythonize_bool(COMPILER_RT_BUILT_WITH_LLVM)
+
 configure_compiler_rt_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
   ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
diff --git a/compiler-rt/test/xray/lit.site.cfg.py.in b/compiler-rt/test/xray/lit.site.cfg.py.in
index 4ed82beb6a2ab..021d999dc7b21 100644
--- a/compiler-rt/test/xray/lit.site.cfg.py.in
+++ b/compiler-rt/test/xray/lit.site.cfg.py.in
@@ -5,7 +5,7 @@ config.name_suffix = "@XRAY_TEST_CONFIG_SUFFIX@"
 config.xray_lit_source_dir = "@XRAY_LIT_SOURCE_DIR@"
 config.target_cflags = "@XRAY_TEST_TARGET_CFLAGS@"
 config.target_arch = "@XRAY_TEST_TARGET_ARCH@"
-config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD AND NOT LLVM_TREE_AVAILABLE@" != "TRUE")
+config.built_with_llvm = "@COMPILER_RT_BUILT_WITH_LLVM@"
 
 # TODO: Look into whether we can run a capability test on the standalone build to
 # see whether it can run 'llvm-xray convert' instead of turning off tests for a



More information about the llvm-commits mailing list