[PATCH] D47994: [Darwin] Do not error on '-lto_library' option

Brian Gesiak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 20:23:58 PDT 2018


modocache updated this revision to Diff 150885.
modocache added a comment.

Thanks for the reviews! I adopted @pcc's suggestion to ignore the option without printing a warning. (I also considered calling `llvm::opt::Arg::claim`, but it looks like no other arguments are claimed, and lld doesn't print warnings for unclaimed arguments anyway.) I updated the help text and the test as well.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47994

Files:
  lib/Driver/DarwinLdOptions.td
  test/darwin/cmdline-lto_library.objtxt


Index: test/darwin/cmdline-lto_library.objtxt
===================================================================
--- /dev/null
+++ test/darwin/cmdline-lto_library.objtxt
@@ -0,0 +1,11 @@
+# RUN: ld64.lld -arch x86_64 -lto_library %t -print-atoms -r %s 2>&1 | FileCheck %s
+#
+# Test that the -lto_library option does not result in an error.
+#
+
+# CHECK-NOT: -lto_library
+
+--- !native
+defined-atoms:
+    - name:              _foo
+...
Index: lib/Driver/DarwinLdOptions.td
===================================================================
--- lib/Driver/DarwinLdOptions.td
+++ lib/Driver/DarwinLdOptions.td
@@ -231,6 +231,10 @@
      MetaVarName<"<number>">,
      HelpText<"Maximum number of errors to emit before stopping (0 = no limit)">;
 
+// Ignored options
+def lto_library : Separate<["-"], "lto_library">,
+    MetaVarName<"<path>">,
+    HelpText<"Ignored for compatibility with other linkers">;
 
 // Obsolete options
 def grp_obsolete : OptionGroup<"obsolete">, HelpText<"OBSOLETE OPTIONS">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47994.150885.patch
Type: text/x-patch
Size: 1011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180612/24c1cd6d/attachment.bin>


More information about the llvm-commits mailing list