[lld] ea32351 - [lld-macho] Ignore -debug_variant flag

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 09:01:09 PST 2023


Author: Keith Smiley
Date: 2023-03-03T09:00:55-08:00
New Revision: ea32351fae6507a086ebd6039aba3ce36f28498d

URL: https://github.com/llvm/llvm-project/commit/ea32351fae6507a086ebd6039aba3ce36f28498d
DIFF: https://github.com/llvm/llvm-project/commit/ea32351fae6507a086ebd6039aba3ce36f28498d.diff

LOG: [lld-macho] Ignore -debug_variant flag

As far as I can tell all this flag does in ld64 is warn about cases
where you're building dylibs that are going to be part of the shared
cache, which I assume only apple is doing. Strangely I have seen this
flag being passed in the wild so this silences the warning about it.

Differential Revision: https://reviews.llvm.org/D145200

Added: 
    

Modified: 
    lld/MachO/Options.td
    lld/test/MachO/silent-ignore.s

Removed: 
    


################################################################################
diff  --git a/lld/MachO/Options.td b/lld/MachO/Options.td
index 80a12f256b4b9..408be46699770 100644
--- a/lld/MachO/Options.td
+++ b/lld/MachO/Options.td
@@ -687,10 +687,6 @@ def no_warn_inits : Flag<["-"], "no_warn_inits">,
     HelpText<"Suppress warnings for static initializers in the output">,
     Flags<[HelpHidden]>,
     Group<grp_rare>;
-def debug_variant : Flag<["-"], "debug_variant">,
-    HelpText<"Suppress warnings germane to binaries shipping to customers">,
-    Flags<[HelpHidden]>,
-    Group<grp_rare>;
 def unaligned_pointers : Separate<["-"], "unaligned_pointers">,
     MetaVarName<"<treatment>">,
     HelpText<"Handle unaligned pointers in __DATA segments according to <treatment>: warning, error, or suppress (default for arm64e is error, otherwise suppress)">,
@@ -1387,3 +1383,7 @@ def objc_abi_version : Separate<["-"], "objc_abi_version">,
     HelpText<"This option only applies to i386 in ld64">,
     Flags<[HelpHidden]>,
     Group<grp_ignored_silently>;
+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>;

diff  --git a/lld/test/MachO/silent-ignore.s b/lld/test/MachO/silent-ignore.s
index efbe30ec421a0..e57342c28a7a6 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
+# RUN: %lld %t.o -o /dev/null -objc_abi_version 2 -debug_variant
 
 .globl _main
 _main:


        


More information about the llvm-commits mailing list