diff options
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 853f694..99de951 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"); @@ -4919,13 +4919,14 @@ Action *Driver::BuildOffloadingActions(Compilation &C, } // HIP code in device-only non-RDC mode will bundle the output if it invoked - // the linker. + // the linker or if the user explicitly requested it. bool ShouldBundleHIP = - HIPNoRDC && offloadDeviceOnly() && Args.hasFlag(options::OPT_gpu_bundle_output, - options::OPT_no_gpu_bundle_output, true) && - !llvm::any_of(OffloadActions, - [](Action *A) { return A->getType() != types::TY_Image; }); + options::OPT_no_gpu_bundle_output, false) || + (HIPNoRDC && offloadDeviceOnly() && + llvm::none_of(OffloadActions, [](Action *A) { + return A->getType() != types::TY_Image; + })); // All kinds exit now in device-only mode except for non-RDC mode HIP. if (offloadDeviceOnly() && !ShouldBundleHIP) |