summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Haarman <llvm@inglorion.net>2017-04-18 22:00:29 +0000
committerBob Haarman <llvm@inglorion.net>2017-04-18 22:00:29 +0000
commit630d0c0f4467e528b7a96664bc75cb2544039515 (patch)
tree3362ab1f492825f1d8db9edd7a744333c2c9371b
parent34e485f92236672c2e97da092f7ad8378609c023 (diff)
downloadbcm5719-llvm-630d0c0f4467e528b7a96664bc75cb2544039515.tar.gz
bcm5719-llvm-630d0c0f4467e528b7a96664bc75cb2544039515.zip
[coff] use newlines instead of spaces as separators in msvclto response file
Summary: Fixes PR32689: /msvclto creates response files with lines that are too long for msvc's linker (LNK1170). Reviewers: hans, rnk, ruiu Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D32185 llvm-svn: 300612
-rw-r--r--lld/COFF/Driver.cpp8
-rw-r--r--lld/COFF/DriverUtils.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index 3e7f10bf8d1..daddfb86d4c 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -509,7 +509,7 @@ filterBitcodeFiles(StringRef Path, std::vector<std::string> &TemporaryFiles) {
// Create response file contents and invoke the MSVC linker.
void LinkerDriver::invokeMSVC(opt::InputArgList &Args) {
- std::string Rsp = "/nologo ";
+ std::string Rsp = "/nologo\n";
std::vector<std::string> Temps;
for (auto *Arg : Args) {
@@ -528,14 +528,14 @@ void LinkerDriver::invokeMSVC(opt::InputArgList &Args) {
case OPT_INPUT: {
if (Optional<StringRef> Path = doFindFile(Arg->getValue())) {
if (Optional<std::string> S = filterBitcodeFiles(*Path, Temps))
- Rsp += quote(*S) + " ";
+ Rsp += quote(*S) + "\n";
continue;
}
- Rsp += quote(Arg->getValue()) + " ";
+ Rsp += quote(Arg->getValue()) + "\n";
break;
}
default:
- Rsp += toString(Arg) + " ";
+ Rsp += toString(Arg) + "\n";
}
}
diff --git a/lld/COFF/DriverUtils.cpp b/lld/COFF/DriverUtils.cpp
index a9c1c9d5593..2c9ba797f73 100644
--- a/lld/COFF/DriverUtils.cpp
+++ b/lld/COFF/DriverUtils.cpp
@@ -634,7 +634,7 @@ void runMSVCLinker(std::string Rsp, ArrayRef<StringRef> Objects) {
std::vector<TemporaryFile> Temps;
for (StringRef S : Objects) {
Temps.emplace_back("lto", "obj", S);
- Rsp += quote(Temps.back().Path) + " ";
+ Rsp += quote(Temps.back().Path) + "\n";
}
log("link.exe " + Rsp);
OpenPOWER on IntegriCloud