[compiler-rt] [sanitizer_common] Fix missing `check-sanitizer` deps under LLVM_ENABLE_RUNTIMES (PR #170817)

Andrew Haberlandt via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 5 00:57:48 PST 2025


https://github.com/ndrewh created https://github.com/llvm/llvm-project/pull/170817

`COMPILER_RT_STANDALONE_BUILD` is set when doing a `LLVM_ENABLE_RUNTIMES` build. This prevents the sanitizer runtimes from being added as dependencies to `check-sanitizer`. Currently, if you make runtime changes and then run `check-sanitizer` you won't actually be testing a rebuilt runtime.

I don't follow why `COMPILER_RT_STANDALONE_BUILD` is even relevant here (was it ever?), so the right thing to do may be to remove the check entirely instead of adding `OR LLVM_RUNTIMES_BUILD` like I'm doing here..

>From 2c2e84cb3d32afcb8e55dae21a5af5bb5bc3af49 Mon Sep 17 00:00:00 2001
From: Andrew Haberlandt <ahaberlandt at apple.com>
Date: Fri, 5 Dec 2025 00:49:21 -0800
Subject: [PATCH] [sanitizer_common] sanitizer_commmon tests should depend on
 runtimes under LLVM_ENABLE_RUNTIMES

---
 compiler-rt/test/sanitizer_common/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt
index 7596e2005a3b5..88bf29f98642b 100644
--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt
+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt
@@ -51,7 +51,7 @@ message(
 # Create a separate config for each tool we support.
 foreach(tool ${SUPPORTED_TOOLS})
   string(TOUPPER ${tool} tool_toupper)
-  if(${tool_toupper}_SUPPORTED_ARCH AND NOT COMPILER_RT_STANDALONE_BUILD)
+  if(${tool_toupper}_SUPPORTED_ARCH AND (NOT COMPILER_RT_STANDALONE_BUILD OR LLVM_RUNTIMES_BUILD))
     list(APPEND SANITIZER_COMMON_TEST_DEPS ${tool})
   endif()
   set(TEST_ARCH ${${tool_toupper}_SUPPORTED_ARCH})



More information about the llvm-commits mailing list