PECOFF: Don't parse files in .drectve asynchronously.
authorRui Ueyama <ruiu@google.com>
Thu, 12 Feb 2015 20:33:40 +0000 (20:33 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 12 Feb 2015 20:33:40 +0000 (20:33 +0000)
Looks like there's a race condition around here that caused LLD to crash
on Windows. Currently we are parsing libraries specified by .drectve section
asynchronously, and something is wrong in that process. Disable the feature
for now to make buildbots happy.

llvm-svn: 228955

lld/lib/Driver/WinLinkDriver.cpp

index b29d235..de6b926 100644 (file)
@@ -1348,10 +1348,8 @@ bool WinLinkDriver::parse(int argc, const char *argv[],
 
   // Add the input files to the linking context.
   for (std::unique_ptr<File> &file : files) {
-    if (isReadingDirectiveSection) {
-      File *f = file.get();
-      ctx.getTaskGroup().spawn([f] { f->parse(); });
-    }
+    if (isReadingDirectiveSection)
+      file.get()->parse();
     ctx.getNodes().push_back(llvm::make_unique<FileNode>(std::move(file)));
   }
 
@@ -1364,10 +1362,8 @@ bool WinLinkDriver::parse(int argc, const char *argv[],
   // Add the library files to the library group.
   for (std::unique_ptr<File> &file : libraries) {
     if (!hasLibrary(ctx, file.get())) {
-      if (isReadingDirectiveSection) {
-        File *f = file.get();
-        ctx.getTaskGroup().spawn([f] { f->parse(); });
-      }
+      if (isReadingDirectiveSection)
+        file.get()->parse();
       ctx.addLibraryFile(llvm::make_unique<FileNode>(std::move(file)));
     }
   }