Skip to content

Commit b7611d9

Browse files
jhuber6fschlimb
authored andcommitted
[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 3170020 commit b7611d9

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)