[lld] [lld-macho] Ignore -no_warn_duplicate_libraries flag (PR #86303)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 09:31:03 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld-macho

Author: Keith Smiley (keith)

<details>
<summary>Changes</summary>

This is a new ld64 flag (along with `-warn_duplicate_libraries`), where the warning is enabled by default, and it can be useful to ignore since it can be hard to dedup library flags across large builds. This doesn't ignore the enabling version since if someone manually passed that and lld didn't respect it, we probably want the user to know that.

---
Full diff: https://github.com/llvm/llvm-project/pull/86303.diff


2 Files Affected:

- (modified) lld/MachO/Options.td (+4) 
- (modified) lld/test/MachO/silent-ignore.s (+1-1) 


``````````diff
diff --git a/lld/MachO/Options.td b/lld/MachO/Options.td
index 0d8ee2a0926be2..b9127595effe8e 100644
--- a/lld/MachO/Options.td
+++ b/lld/MachO/Options.td
@@ -1407,3 +1407,7 @@ def debug_variant : Flag<["-"], "debug_variant">,
     HelpText<"Do not warn about issues that are only problems for binaries shipping to customers.">,
     Flags<[HelpHidden]>,
     Group<grp_ignored_silently>;
+def no_warn_duplicate_libraries : Flag<["-"], "no_warn_duplicate_libraries">,
+    HelpText<"Do not warn if the input contains duplicate library options.">,
+    Flags<[HelpHidden]>,
+    Group<grp_ignored_silently>;
diff --git a/lld/test/MachO/silent-ignore.s b/lld/test/MachO/silent-ignore.s
index e57342c28a7a6b..58c3cc148f07b0 100644
--- a/lld/test/MachO/silent-ignore.s
+++ b/lld/test/MachO/silent-ignore.s
@@ -20,7 +20,7 @@
 
 ## Check that we don't emit any warnings nor errors for these unimplemented flags.
 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
-# RUN: %lld %t.o -o /dev/null -objc_abi_version 2 -debug_variant
+# RUN: %lld %t.o -o /dev/null -objc_abi_version 2 -debug_variant -no_warn_duplicate_libraries
 
 .globl _main
 _main:

``````````

</details>


https://github.com/llvm/llvm-project/pull/86303


More information about the llvm-commits mailing list