diff --git a/lld/MachO/Config.h b/lld/MachO/Config.h --- a/lld/MachO/Config.h +++ b/lld/MachO/Config.h @@ -35,6 +35,7 @@ bool hasReexports = false; bool allLoad = false; bool forceLoadObjC = false; + bool staticLink = false; uint32_t headerPad; llvm::StringRef installName; llvm::StringRef outputFile; diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -525,6 +525,9 @@ config->runtimePaths = args::getStrings(args, OPT_rpath); config->allLoad = args.hasArg(OPT_all_load); + if (const opt::Arg *arg = args.getLastArg(OPT_static, OPT_dynamic)) + config->staticLink = (arg->getOption().getID() == OPT_static); + std::vector &roots = config->systemLibraryRoots; for (const Arg *arg : args.filtered(OPT_syslibroot)) roots.push_back(arg->getValue()); @@ -603,6 +606,7 @@ case OPT_arch: case OPT_syslibroot: case OPT_sectcreate: + case OPT_dynamic: // handled elsewhere break; default: diff --git a/lld/MachO/Options.td b/lld/MachO/Options.td --- a/lld/MachO/Options.td +++ b/lld/MachO/Options.td @@ -37,7 +37,6 @@ Group; def dynamic : Flag<["-"], "dynamic">, HelpText<"Link dynamically (default)">, - Flags<[HelpHidden]>, Group; def static : Flag<["-"], "static">, HelpText<"Link statically">,