[mach-o] Add support for -single_module and -multi_module

These are both obsolete options that controled how dylibs were built.

llvm-svn: 216205
This commit is contained in:
Nick Kledzik 2014-08-21 18:57:42 +00:00
parent 5b0e0e9436
commit e484075d82
2 changed files with 20 additions and 0 deletions

View File

@ -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();

View File

@ -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>;