diff options
author | Joseph Huber <huberjn@outlook.com> | 2025-07-28 11:36:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-28 11:36:31 -0500 |
commit | 4f58c829fd8473b11c2e6c6ee424b2432e02fb56 (patch) | |
tree | ea027897946cf437f2b3e19ee9d7a44b0ebeab94 | |
parent | 0121a8e4319619527c9c28bbc01c74f794cc2255 (diff) | |
download | llvm-4f58c829fd8473b11c2e6c6ee424b2432e02fb56.zip llvm-4f58c829fd8473b11c2e6c6ee424b2432e02fb56.tar.gz llvm-4f58c829fd8473b11c2e6c6ee424b2432e02fb56.tar.bz2 |
[Clang] Search for 'offload-arch' only next to the clang driver (#150965)
Summary:
Previously, querying for the offload architecture tool would invoke the
user's PATH, which is bad when potentially using the driver from a
direct path. This patch change this to *only* consider the
`offload-arch` that's supposed to live next to the driver executable.
Now we will no longer pick up a potentially conflicting version of this
tool and it should always be found (Since it's a clang tool that's
installazed alongside the driver)
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 853f694..b90bd1d 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -910,7 +910,7 @@ getSystemOffloadArchs(Compilation &C, Action::OffloadKind Kind) { SmallVector<std::string> GPUArchs; if (llvm::ErrorOr<std::string> Executable = - llvm::sys::findProgramByName(Program)) { + llvm::sys::findProgramByName(Program, {C.getDriver().Dir})) { llvm::SmallVector<StringRef> Args{*Executable}; if (Kind == Action::OFK_HIP) Args.push_back("--only=amdgpu"); |