[PATCH] D49319: lld-link: Add /lib to Options.td so that it appears in lld-link's help output.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 13 20:02:34 PDT 2018


thakis updated this revision to Diff 155545.
thakis added a comment.

Sure, done.


https://reviews.llvm.org/D49319

Files:
  COFF/DriverUtils.cpp
  COFF/Options.td
  test/COFF/driver.test


Index: test/COFF/driver.test
===================================================================
--- test/COFF/driver.test
+++ test/COFF/driver.test
@@ -9,3 +9,9 @@
 # RUN: lld-link /out:%t.dll /dll %t.obj
 # RUN: not lld-link /out:%t.exe %t.dll 2>&1 | FileCheck -check-prefix=BADFILE %s
 BADFILE: bad file type. Did you specify a DLL instead of an import library?
+
+# RUN: lld-link /lib /? | FileCheck -check-prefix=LIBHELP %s
+LIBHELP: OVERVIEW: LLVM Lib
+
+# RUN: not lld-link /WX /lib 2>&1 | FileCheck -check-prefix=LIBBAD %s
+LIBBAD: ignoring /lib since it's not the first argument
Index: COFF/Options.td
===================================================================
--- COFF/Options.td
+++ COFF/Options.td
@@ -36,6 +36,8 @@
 def heap    : P<"heap", "Size of the heap">;
 def ignore : P<"ignore", "Specify warning codes to ignore">;
 def implib  : P<"implib", "Import library name">;
+def lib : F<"lib">,
+    HelpText<"Act like lib.exe; must be first argument if present">;
 def libpath : P<"libpath", "Additional library search path">;
 def linkrepro : P<"linkrepro", "Dump linker invocation and input files for debugging">;
 def lldltocache : P<"lldltocache", "Path to ThinLTO cached object file directory">;
Index: COFF/DriverUtils.cpp
===================================================================
--- COFF/DriverUtils.cpp
+++ COFF/DriverUtils.cpp
@@ -821,6 +821,10 @@
 
   for (auto *Arg : Args.filtered(OPT_UNKNOWN))
     warn("ignoring unknown argument: " + Arg->getSpelling());
+
+  if (Args.hasArg(OPT_lib))
+    warn("ignoring /lib since it's not the first argument");
+
   return Args;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49319.155545.patch
Type: text/x-patch
Size: 1620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180714/db65ea7e/attachment.bin>


More information about the llvm-commits mailing list