diff options
| -rw-r--r-- | lld/lib/Driver/DarwinLdDriver.cpp | 13 | ||||
| -rw-r--r-- | lld/lib/Driver/DarwinLdOptions.td | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lld/lib/Driver/DarwinLdDriver.cpp b/lld/lib/Driver/DarwinLdDriver.cpp index 531acb25c4e..259cf758c79 100644 --- a/lld/lib/Driver/DarwinLdDriver.cpp +++ b/lld/lib/Driver/DarwinLdDriver.cpp @@ -517,6 +517,19 @@ bool DarwinLdDriver::parse(int argc, const char *argv[], ctx.addExportSymbol(symbol->getValue()); } + // Handle obosolete -multi_module and -single_module + if (llvm::opt::Arg *mod = parsedArgs->getLastArg(OPT_multi_module, + OPT_single_module)) { + if (mod->getOption().getID() == OPT_multi_module) { + diagnostics << "warning: -multi_module is obsolete and being ignored\n"; + } + else { + if (ctx.outputMachOType() != llvm::MachO::MH_DYLIB) + diagnostics << "-single_module only used when creating a dylib\n"; + return false; + } + } + // Handle input files for (auto &arg : *parsedArgs) { ErrorOr<StringRef> resolvedPath = StringRef(); diff --git a/lld/lib/Driver/DarwinLdOptions.td b/lld/lib/Driver/DarwinLdOptions.td index 0ed7fe1500d..d5d95b6e07f 100644 --- a/lld/lib/Driver/DarwinLdOptions.td +++ b/lld/lib/Driver/DarwinLdOptions.td @@ -140,3 +140,10 @@ def t : Flag<["-"], "t">, HelpText<"Print the names of the input files as ld processes them">; def v : Flag<["-"], "v">, HelpText<"Print linker information">; + +// Obsolete options +def grp_obsolete : OptionGroup<"obsolete">, HelpText<"OBSOLETE OPTIONS">; +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>; |

