Author: Joseph Huber
Date: 2026-01-30T08:03:33-06:00
New Revision: e05ce8fa4c34bedc34fbd4de73987afa9e46534a

URL: 
https://github.com/llvm/llvm-project/commit/e05ce8fa4c34bedc34fbd4de73987afa9e46534a
DIFF: 
https://github.com/llvm/llvm-project/commit/e05ce8fa4c34bedc34fbd4de73987afa9e46534a.diff

LOG: [SPIRV] Properly discover LLVM tools that live next to the compiler 
(#178779)

Summary:
When we compile with `-emit-llvm` it will try to use `llvm-link`. The
toolchain does not properly add the driver directory as a valid path so
this will default to the user's search path. This, like other tools,
should prioritize the binaries living next to the compiler.

Side note, why is this not default behavior?

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/SPIRV.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/SPIRV.cpp 
b/clang/lib/Driver/ToolChains/SPIRV.cpp
index 81fd2afc6e9c7..c1ccb1e7d8508 100644
--- a/clang/lib/Driver/ToolChains/SPIRV.cpp
+++ b/clang/lib/Driver/ToolChains/SPIRV.cpp
@@ -172,6 +172,9 @@ SPIRVToolChain::SPIRVToolChain(const Driver &D, const 
llvm::Triple &Triple,
   // TODO: Revisit need/use of --sycl-link option once SYCL toolchain is
   // available and SYCL linking support is moved there.
   NativeLLVMSupport = Args.hasArg(options::OPT_sycl_link);
+
+  // Lookup binaries into the driver directory.
+  getProgramPaths().push_back(getDriver().Dir);
 }
 
 bool SPIRVToolChain::HasNativeLLVMSupport() const { return NativeLLVMSupport; }


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to