[PATCH] D69968: [COFF] Don't error if the only inputs are from /wholearchive:

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 13:58:12 PST 2019


rnk created this revision.
rnk added reviewers: amccarth, inglorion.
Herald added a project: LLVM.

Fixes PR43744


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69968

Files:
  lld/COFF/Driver.cpp
  lld/test/COFF/wholearchive.s


Index: lld/test/COFF/wholearchive.s
===================================================================
--- lld/test/COFF/wholearchive.s
+++ lld/test/COFF/wholearchive.s
@@ -14,6 +14,10 @@
 # RUN: lld-link -dll -out:%t.dll -entry:main %t.main.obj %t.archive.lib -wholearchive:%t.archive.lib -implib:%t.lib
 # RUN: llvm-readobj %t.lib | FileCheck %s -check-prefix CHECK-IMPLIB
 
+# PR43744: Test no inputs except a whole archive.
+# RUN: lld-link -dll -out:%t.dll -noentry -wholearchive:%t.archive.lib -implib:%t.lib
+# RUN: llvm-readobj %t.lib | FileCheck %s -check-prefix CHECK-IMPLIB
+
 # RUN: mkdir -p %t.dir
 # RUN: cp %t.archive.lib %t.dir/foo.lib
 # RUN: lld-link -dll -out:%t.dll -entry:main -libpath:%t.dir %t.main.obj %t.dir/./foo.lib -wholearchive:foo.lib -implib:%t.lib
Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -1163,7 +1163,7 @@
     }
   }
 
-  if (!args.hasArg(OPT_INPUT)) {
+  if (!args.hasArg(OPT_INPUT, OPT_wholearchive_file)) {
     if (args.hasArg(OPT_deffile))
       config->noEntry = true;
     else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69968.228309.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191107/55f014ca/attachment.bin>


More information about the llvm-commits mailing list