diff options
| -rw-r--r-- | lld/lib/Driver/DarwinLdDriver.cpp | 16 | ||||
| -rw-r--r-- | lld/lib/Driver/DarwinLdOptions.td | 6 | ||||
| -rw-r--r-- | lld/test/darwin/cmdline-objc_gc.objtxt | 15 | ||||
| -rw-r--r-- | lld/test/darwin/cmdline-objc_gc_compaction.objtxt | 15 | ||||
| -rw-r--r-- | lld/test/darwin/cmdline-objc_gc_only.objtxt | 15 |
5 files changed, 67 insertions, 0 deletions
diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp index 40fad74c952..984958c905c 100644 --- a/lld/lib/Driver/DarwinLdDriver.cpp +++ b/lld/lib/Driver/DarwinLdDriver.cpp @@ -673,6 +673,22 @@ bool DarwinLdDriver::parse(llvm::ArrayRef<const char *> args, } } + // Handle obsolete ObjC options: -objc_gc_compaction, -objc_gc, -objc_gc_only + if (parsedArgs.getLastArg(OPT_objc_gc_compaction)) { + diagnostics << "error: -objc_gc_compaction is not supported\n"; + return false; + } + + if (parsedArgs.getLastArg(OPT_objc_gc)) { + diagnostics << "error: -objc_gc is not supported\n"; + return false; + } + + if (parsedArgs.getLastArg(OPT_objc_gc_only)) { + diagnostics << "error: -objc_gc_only is not supported\n"; + return false; + } + // Handle -pie or -no_pie if (llvm::opt::Arg *pie = parsedArgs.getLastArg(OPT_pie, OPT_no_pie)) { switch (ctx.outputMachOType()) { diff --git a/lld/lib/Driver/DarwinLdOptions.td b/lld/lib/Driver/DarwinLdOptions.td index cbf6ac1d4a4..2fad19cc2d5 100644 --- a/lld/lib/Driver/DarwinLdOptions.td +++ b/lld/lib/Driver/DarwinLdOptions.td @@ -205,3 +205,9 @@ def single_module : Flag<["-"], "single_module">, HelpText<"Default for dylibs">, Group<grp_obsolete>; def multi_module : Flag<["-"], "multi_module">, HelpText<"Unsupported way to build dylibs">, Group<grp_obsolete>; +def objc_gc_compaction : Flag<["-"], "objc_gc_compaction">, + HelpText<"Unsupported ObjC GC option">, Group<grp_obsolete>; +def objc_gc : Flag<["-"], "objc_gc">, + HelpText<"Unsupported ObjC GC option">, Group<grp_obsolete>; +def objc_gc_only : Flag<["-"], "objc_gc_only">, + HelpText<"Unsupported ObjC GC option">, Group<grp_obsolete>; diff --git a/lld/test/darwin/cmdline-objc_gc.objtxt b/lld/test/darwin/cmdline-objc_gc.objtxt new file mode 100644 index 00000000000..b5225a1d184 --- /dev/null +++ b/lld/test/darwin/cmdline-objc_gc.objtxt @@ -0,0 +1,15 @@ +# RUN: not lld -flavor darwin -arch x86_64 -objc_gc %s 2>&1 | FileCheck %s +# +# Test that the -objc_gc is rejected. +# + +# CHECK: error: -objc_gc is not supported + +--- !native +defined-atoms: + - name: _main + type: code + scope: global + content: [ 0x90 ] + +... diff --git a/lld/test/darwin/cmdline-objc_gc_compaction.objtxt b/lld/test/darwin/cmdline-objc_gc_compaction.objtxt new file mode 100644 index 00000000000..acf7183d95e --- /dev/null +++ b/lld/test/darwin/cmdline-objc_gc_compaction.objtxt @@ -0,0 +1,15 @@ +# RUN: not lld -flavor darwin -arch x86_64 -objc_gc_compaction %s 2>&1 | FileCheck %s +# +# Test that the -objc_gc_compaction is rejected. +# + +# CHECK: error: -objc_gc_compaction is not supported + +--- !native +defined-atoms: + - name: _main + type: code + scope: global + content: [ 0x90 ] + +... diff --git a/lld/test/darwin/cmdline-objc_gc_only.objtxt b/lld/test/darwin/cmdline-objc_gc_only.objtxt new file mode 100644 index 00000000000..db1cef94ea5 --- /dev/null +++ b/lld/test/darwin/cmdline-objc_gc_only.objtxt @@ -0,0 +1,15 @@ +# RUN: not lld -flavor darwin -arch x86_64 -objc_gc_only %s 2>&1 | FileCheck %s +# +# Test that the -objc_gc_only is rejected. +# + +# CHECK: error: -objc_gc_only is not supported + +--- !native +defined-atoms: + - name: _main + type: code + scope: global + content: [ 0x90 ] + +... |

