diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp --- a/lld/COFF/Driver.cpp +++ b/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 diff --git a/lld/test/COFF/wholearchive.s b/lld/test/COFF/wholearchive.s --- a/lld/test/COFF/wholearchive.s +++ b/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