diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -766,6 +766,8 @@ case OPT_grp_ignored: warn("Option `" + opt.getPrefixedName() + "' is ignored."); break; + case OPT_grp_ignored_silently: + break; default: warn("Option `" + opt.getPrefixedName() + "' is not yet implemented. Stay tuned..."); diff --git a/lld/MachO/Options.td b/lld/MachO/Options.td --- a/lld/MachO/Options.td +++ b/lld/MachO/Options.td @@ -865,10 +865,6 @@ HelpText<"Suppresses warnings about inputs whose architecture does not match the -arch option">, Flags<[HelpHidden]>, Group; -def arch_errors_fatal : Flag<["-"], "arch_errors_fatal">, - HelpText<"Escalate to errors any warnings about inputs whose architecture does not match the -arch option">, - Flags<[HelpHidden]>, - Group; def e : Separate<["-"], "e">, MetaVarName<"">, HelpText<"Make the entry point of an executable (default is \"start\" from crt1.o)">, @@ -1331,3 +1327,10 @@ HelpText<"This option is ignored in ld64">, Flags<[HelpHidden]>, Group; + +def grp_ignored_silently : OptionGroup<"ignored_silently">, HelpText<"IGNORED SILENTLY">; + +def arch_errors_fatal : Flag<["-"], "arch_errors_fatal">, + HelpText<"Escalate to errors any warnings about inputs whose architecture does not match the -arch option, enabled by default">, + Flags<[HelpHidden]>, + Group; diff --git a/lld/test/MachO/invalid/incompatible-arch.s b/lld/test/MachO/invalid/incompatible-arch.s --- a/lld/test/MachO/invalid/incompatible-arch.s +++ b/lld/test/MachO/invalid/incompatible-arch.s @@ -3,7 +3,9 @@ # RUN: rm -rf %t && mkdir -p %t # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t/test.o +# RUN: %lld -arch arm64 -lSystem %t/test.o -o /dev/null -arch_errors_fatal # RUN: not %lld -arch x86_64 -lSystem %t/test.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/test.o +# RUN: not %lld -arch x86_64 -arch_errors_fatal -lSystem %t/test.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/test.o # CHECK: error: {{.*}}[[FILE]] has architecture arm64 which is incompatible with target architecture x86_64 # RUN: %lld -dylib -arch arm64 -platform_version macOS 10.14 10.15 -o %t/out.dylib %t/test.o