[PATCH] D32185: [coff] use newlines instead of spaces as separators in msvclto response file

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 12:59:50 PDT 2017


inglorion created this revision.
Herald added a subscriber: mehdi_amini.

Fixes PR32689: /msvclto creates response files with lines
that are too long for msvc's linker (LNK1170).


https://reviews.llvm.org/D32185

Files:
  COFF/Driver.cpp
  COFF/DriverUtils.cpp


Index: COFF/DriverUtils.cpp
===================================================================
--- COFF/DriverUtils.cpp
+++ COFF/DriverUtils.cpp
@@ -634,7 +634,7 @@
   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);
Index: COFF/Driver.cpp
===================================================================
--- COFF/Driver.cpp
+++ COFF/Driver.cpp
@@ -509,7 +509,7 @@
 
 // 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 @@
     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";
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32185.95613.patch
Type: text/x-patch
Size: 1301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170418/24e02fa6/attachment.bin>


More information about the llvm-commits mailing list