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

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 09:19:10 PDT 2024


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

>From 4e08cc996317ddfac865b6d063c2183fc14d1db4 Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Fri, 22 Mar 2024 09:28:58 -0700
Subject: [PATCH] [lld-macho] Ignore -no_warn_duplicate_libraries flag

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.
---
 lld/MachO/Options.td           | 6 ++++++
 lld/test/MachO/silent-ignore.s | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lld/MachO/Options.td b/lld/MachO/Options.td
index 0d8ee2a0926be2..ea4a207a7f6f36 100644
--- a/lld/MachO/Options.td
+++ b/lld/MachO/Options.td
@@ -1407,3 +1407,9 @@ 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>;
+
+// NOTE: This flag should be respected if -warn_duplicate_libraries is ever implemented.
+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:



More information about the llvm-commits mailing list