[llvm] libclc: Pass LLVM_NATIVE_TOOL_DIR to runtime builds (PR #196498)
Konrad Kleine via llvm-commits
llvm-commits at lists.llvm.org
Fri May 8 02:17:24 PDT 2026
https://github.com/kwk updated https://github.com/llvm/llvm-project/pull/196498
>From b7ea09f0b9832a86cc8622148d7139415bb84e85 Mon Sep 17 00:00:00 2001
From: Fedora LLVM Team <llvm at fedoraproject.org>
Date: Fri, 24 Apr 2026 00:00:00 +0000
Subject: [PATCH] libclc: Pass LLVM_NATIVE_TOOL_DIR to runtime builds
This patch sets `LLVM_NATIVE_TOOL_DIR` in the runtime build configuration to point to the directory containing the just-built LLVM tools, allowing libclc to find them without requiring them to be installed on the host system.
Fixes build errors like:
```
Error evaluating generator expression: $<TARGET_FILE:opt>
No target "opt"
```
A few lines above this change, `extra_deps` list of dependencies for libclc is created. But those tools don't get build in the runtime build. We build libclc in the monolithic build and there we have all the tools which is why I've added the path to discover the tools.
---
llvm/runtimes/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 1e074526d0f7c..9dc4c35ac02b7 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -582,6 +582,8 @@ if(build_runtimes)
list(APPEND extra_deps ${dep})
endif()
endforeach()
+ # Pass the location of LLVM tools to the runtime build so libclc can find them
+ list(APPEND extra_cmake_args "-DLLVM_NATIVE_TOOL_DIR=${LLVM_RUNTIME_OUTPUT_INTDIR}")
endif()
# Tools needed by build_symbolizer.sh.
if("compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES AND COMPILER_RT_ENABLE_INTERNAL_SYMBOLIZER)
More information about the llvm-commits
mailing list