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

Nick Kledzik kledzik at apple.com
Thu Aug 21 11:57:43 PDT 2014


Author: kledzik
Date: Thu Aug 21 13:57:42 2014
New Revision: 216205

URL: http://llvm.org/viewvc/llvm-project?rev=216205&view=rev
Log:
[mach-o] Add support for -single_module and -multi_module

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

Modified:
    lld/trunk/lib/Driver/DarwinLdDriver.cpp
    lld/trunk/lib/Driver/DarwinLdOptions.td

Modified: lld/trunk/lib/Driver/DarwinLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdDriver.cpp?rev=216205&r1=216204&r2=216205&view=diff
==============================================================================
--- lld/trunk/lib/Driver/DarwinLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/DarwinLdDriver.cpp Thu Aug 21 13:57:42 2014
@@ -517,6 +517,19 @@ bool DarwinLdDriver::parse(int argc, con
     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();

Modified: lld/trunk/lib/Driver/DarwinLdOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdOptions.td?rev=216205&r1=216204&r2=216205&view=diff
==============================================================================
--- lld/trunk/lib/Driver/DarwinLdOptions.td (original)
+++ lld/trunk/lib/Driver/DarwinLdOptions.td Thu Aug 21 13:57:42 2014
@@ -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>;





More information about the llvm-commits mailing list