[PATCH] D113068: [lld-macho] Add -fatal-warnings alias

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 16:03:08 PDT 2021


keith created this revision.
Herald added subscribers: jeroen.dobbelaere, dang.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
keith requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This behaves the same as -fatal_warnings but provides a consistent
interface with ld.lld and ld.gold. This is useful for build tools like
bazel to be able to provide a consistent interface for 'warnings as
errors' to the linker.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113068

Files:
  lld/MachO/Options.td
  lld/test/MachO/fatal-warnings.s


Index: lld/test/MachO/fatal-warnings.s
===================================================================
--- lld/test/MachO/fatal-warnings.s
+++ lld/test/MachO/fatal-warnings.s
@@ -3,8 +3,12 @@
 
 # RUN: %no_fatal_warnings_lld %t1.o -o /dev/null -single_module 2>&1 \
 # RUN:     | FileCheck -check-prefix=WARNING %s
+# RUN: %no_fatal_warnings_lld %t1.o -o /dev/null -fatal_warnings
+# RUN: %no_fatal_warnings_lld %t1.o -o /dev/null -fatal-warnings
 # RUN: not %no_fatal_warnings_lld %t1.o -fatal_warnings -o /dev/null \
 # RUN:     -single_module 2>&1 | FileCheck -check-prefix=ERROR %s
+# RUN: not %no_fatal_warnings_lld %t1.o -fatal-warnings -o /dev/null \
+# RUN:     -single_module 2>&1 | FileCheck -check-prefix=ERROR %s
 
 # ERROR: error: Option `-single_module' is deprecated
 # WARNING: warning: Option `-single_module' is deprecated
Index: lld/MachO/Options.td
===================================================================
--- lld/MachO/Options.td
+++ lld/MachO/Options.td
@@ -701,6 +701,11 @@
 def fatal_warnings : Flag<["-"], "fatal_warnings">,
     HelpText<"Treat warnings as errors">,
     Group<grp_rare>;
+def _fatal_warnings : Flag<["-"], "fatal-warnings">,
+    Alias<fatal_warnings>,
+    HelpText<"Alias for -fatal_warnings to match other platforms">,
+    Flags<[HelpHidden]>,
+    Group<grp_rare>;
 def no_eh_labels : Flag<["-"], "no_eh_labels">,
     HelpText<"In -r mode, suppress .eh labels in the __eh_frame section">,
     Flags<[HelpHidden]>,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113068.384267.patch
Type: text/x-patch
Size: 1480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211102/983e69ef/attachment.bin>


More information about the llvm-commits mailing list