Skip to content

Commit 4f58c82

Browse files
authored
[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)
1 parent 0121a8e commit 4f58c82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ getSystemOffloadArchs(Compilation &C, Action::OffloadKind Kind) {
910910

911911
SmallVector<std::string> GPUArchs;
912912
if (llvm::ErrorOr<std::string> Executable =
913-
llvm::sys::findProgramByName(Program)) {
913+
llvm::sys::findProgramByName(Program, {C.getDriver().Dir})) {
914914
llvm::SmallVector<StringRef> Args{*Executable};
915915
if (Kind == Action::OFK_HIP)
916916
Args.push_back("--only=amdgpu");

0 commit comments

Comments
 (0)