Skip to content

Commit 6fb36db

Browse files
authored
[LinkerWrapper] Fix 'save-temps' when targeting SPIR-V (llvm#144605)
Summary: The logic here is flawed, it was only intended to apply to the CPU case where we use the linker passed in on the command line. This was falsely applying to SPIR-V which caused issues.
1 parent 844e41c commit 6fb36db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ Expected<std::string> findProgram(StringRef Name, ArrayRef<StringRef> Paths) {
268268
bool linkerSupportsLTO(const ArgList &Args) {
269269
llvm::Triple Triple(Args.getLastArgValue(OPT_triple_EQ));
270270
return Triple.isNVPTX() || Triple.isAMDGPU() ||
271-
Args.getLastArgValue(OPT_linker_path_EQ).ends_with("lld");
271+
(!Triple.isGPU() &&
272+
Args.getLastArgValue(OPT_linker_path_EQ).ends_with("lld"));
272273
}
273274

274275
/// Returns the hashed value for a constant string.

0 commit comments

Comments
 (0)