Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lld-macho] Ignore -no_warn_duplicate_libraries flag #86303

Merged

Conversation

keith
Copy link
Member

@keith keith commented Mar 22, 2024

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.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 22, 2024

@llvm/pr-subscribers-lld

@llvm/pr-subscribers-lld-macho

Author: Keith Smiley (keith)

Changes

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 --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:

@keith keith force-pushed the ks/lld-macho-ignore-no_warn_duplicate_libraries-flag branch from 32a90d9 to 89511ee Compare March 22, 2024 16:32
Copy link
Contributor

@thevinster thevinster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

lld/MachO/Options.td Show resolved Hide resolved
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.
@keith keith force-pushed the ks/lld-macho-ignore-no_warn_duplicate_libraries-flag branch from 89511ee to 4e08cc9 Compare March 28, 2024 16:19
@keith keith merged commit 39fe729 into llvm:main Mar 28, 2024
3 of 4 checks passed
@keith keith deleted the ks/lld-macho-ignore-no_warn_duplicate_libraries-flag branch March 28, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants