Skip to content

Commit 87b94d5

Browse files
authored
[Driver][SYCL] Enable use of response files for sycl link step (#2052)
It was found that with large command lines, with large numbers of files, The default response file usage for sycl-link would end up failing at the llvm-link stage due to the length of the command line. All of the tools within the sycl-link step (clang-offload-wrapper, llvm-link, llvm-spirv, llc) all support full response files. Go ahead and enable usage of full response files for sycl-link. Signed-off-by: Michael D Toguchi <[email protected]>
1 parent 3f58ec4 commit 87b94d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7900,5 +7900,5 @@ void PartialLink::ConstructJob(Compilation &C, const JobAction &JA,
79007900
LinkArgs.push_back(TCArgs.MakeArgString(HTC->GetFilePath("crtn.o")));
79017901
const char *Exec = TCArgs.MakeArgString(getToolChain().GetLinkerPath());
79027902
C.addCommand(std::make_unique<Command>(
7903-
JA, *this, ResponseFileSupport::None(), Exec, LinkArgs, Inputs));
7903+
JA, *this, ResponseFileSupport::AtFileCurCP(), Exec, LinkArgs, Inputs));
79047904
}

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const char *SYCL::Linker::constructLLVMSpirvCommand(Compilation &C,
5151
llvm::sys::path::append(LLVMSpirvPath, "llvm-spirv");
5252
const char *LLVMSpirv = C.getArgs().MakeArgString(LLVMSpirvPath);
5353
C.addCommand(std::make_unique<Command>(
54-
JA, *this, ResponseFileSupport::None(), LLVMSpirv, CmdArgs, None));
54+
JA, *this, ResponseFileSupport::AtFileUTF8(), LLVMSpirv, CmdArgs, None));
5555
return OutputFileName;
5656
}
5757

@@ -128,7 +128,7 @@ const char *SYCL::Linker::constructLLVMLinkCommand(Compilation &C,
128128
llvm::sys::path::append(ExecPath, "llvm-link");
129129
const char *Exec = C.getArgs().MakeArgString(ExecPath);
130130
C.addCommand(std::make_unique<Command>(
131-
JA, *this, ResponseFileSupport::None(), Exec, CmdArgs, None));
131+
JA, *this, ResponseFileSupport::AtFileUTF8(), Exec, CmdArgs, None));
132132
return OutputFileName;
133133
}
134134

@@ -142,7 +142,7 @@ void SYCL::Linker::constructLlcCommand(Compilation &C, const JobAction &JA,
142142
llvm::sys::path::append(LlcPath, "llc");
143143
const char *Llc = C.getArgs().MakeArgString(LlcPath);
144144
C.addCommand(std::make_unique<Command>(
145-
JA, *this, ResponseFileSupport::None(), Llc, LlcArgs, None));
145+
JA, *this, ResponseFileSupport::AtFileUTF8(), Llc, LlcArgs, None));
146146
}
147147

148148
// For SYCL the inputs of the linker job are SPIR-V binaries and output is

0 commit comments

Comments
 (0)