[lld] [lld-macho] Ignore -no_warn_duplicate_libraries flag (PR #86303)
Keith Smiley via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 22 09:30:34 PDT 2024
https://github.com/keith created https://github.com/llvm/llvm-project/pull/86303
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.
>From 32a90d9a91759712fe3bd79486fcc3e4983618a8 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 | 4 ++++
lld/test/MachO/silent-ignore.s | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
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:
More information about the llvm-commits
mailing list