include "llvm/Option/OptParser.td" // Flags that lld/MachO understands but ld64 doesn't. These take // '--' instead of '-' and use dashes instead of underscores, so // they don't collide with the ld64 compat options. def grp_lld : OptionGroup<"kind">, HelpText<"LLD-SPECIFIC">; def help : Flag<["-", "--"], "help">, Group; def help_hidden : Flag<["--"], "help-hidden">, HelpText<"Display help for hidden options">, Group; def verbose : Flag<["--"], "verbose">, Group; def error_limit_eq : Joined<["--"], "error-limit=">, HelpText<"Maximum number of errors to print before exiting (default: 20)">, Group; def color_diagnostics: Flag<["--"], "color-diagnostics">, HelpText<"Alias for --color-diagnostics=always">, Group; def no_color_diagnostics: Flag<["--"], "no-color-diagnostics">, HelpText<"Alias for --color-diagnostics=never">, Group; def color_diagnostics_eq: Joined<["--"], "color-diagnostics=">, HelpText<"Use colors in diagnostics (default: auto)">, MetaVarName<"[auto,always,never]">, Group; def threads_eq : Joined<["--"], "threads=">, HelpText<"Number of threads. '1' disables multi-threading. By default all available hardware threads are used">, Group; def thinlto_jobs_eq : Joined<["--"], "thinlto-jobs=">, HelpText<"Number of ThinLTO jobs. Default to --threads=">, Group; def reproduce: Separate<["--"], "reproduce">, Group; def reproduce_eq: Joined<["--"], "reproduce=">, Alias(reproduce)>, HelpText<"Write tar file containing inputs and command to reproduce link">, Group; def version: Flag<["--"], "version">, HelpText<"Display the version number and exit">, Group; def lto_legacy_pass_manager: Flag<["--"], "lto-legacy-pass-manager">, HelpText<"Use the legacy pass manager in LLVM">, Group; def no_lto_legacy_pass_manager : Flag<["--"], "no-lto-legacy-pass-manager">, HelpText<"Use the new pass manager in LLVM">, Group; def time_trace: Flag<["--"], "time-trace">, HelpText<"Record time trace">, Group; def time_trace_granularity_eq: Joined<["--"], "time-trace-granularity=">, HelpText<"Minimum time granularity (in microseconds) traced by time profiler">, Group; def time_trace_file_eq: Joined<["--"], "time-trace-file=">, HelpText<"Specify time trace output file">, Group; def deduplicate_literals: Flag<["--"], "deduplicate-literals">, HelpText<"Enable literal deduplication. This is implied by --icf={safe,all}">, Group; def print_dylib_search: Flag<["--"], "print-dylib-search">, HelpText<"Print which paths lld searched when trying to find dylibs">, Group; def icf_eq: Joined<["--"], "icf=">, HelpText<"Set level for identical code folding (default: none)">, MetaVarName<"[none,safe,all]">, Group; def lto_O: Joined<["--"], "lto-O">, HelpText<"Set optimization level for LTO (default: 2)">, MetaVarName<"">, Group; def thinlto_cache_policy: Joined<["--"], "thinlto-cache-policy=">, HelpText<"Pruning policy for the ThinLTO cache">, Group; def O : JoinedOrSeparate<["-"], "O">, HelpText<"Optimize output file size">; // This is a complete Options.td compiled from Apple's ld(1) manpage // dated 2018-03-07 and cross checked with ld64 source code in repo // https://github.com/apple-opensource/ld64 at git tag "512.4" dated // 2018-03-18. // Flags<[HelpHidden]> marks options that are not yet ported to lld, // and serve as a scoreboard for annotating our progress toward // implementing ld64 options in lld. As you add implementions to // Driver.cpp, please remove the hidden flag here. def grp_kind : OptionGroup<"kind">, HelpText<"OUTPUT KIND">; def execute : Flag<["-"], "execute">, HelpText<"Produce a main executable (default)">, Group; def dylib : Flag<["-"], "dylib">, HelpText<"Produce a shared library">, Group; def bundle : Flag<["-"], "bundle">, HelpText<"Produce a bundle">, Group; def r : Flag<["-"], "r">, HelpText<"Merge multiple object files into one, retaining relocations">, Flags<[HelpHidden]>, Group; def dylinker : Flag<["-"], "dylinker">, HelpText<"Produce a dylinker only used when building dyld">, Flags<[HelpHidden]>, Group; def dynamic : Flag<["-"], "dynamic">, HelpText<"Link dynamically (default)">, Group; def static : Flag<["-"], "static">, HelpText<"Link statically">, Flags<[HelpHidden]>, Group; def preload : Flag<["-"], "preload">, HelpText<"Produce an unsegmented binary for embedded systems">, Flags<[HelpHidden]>, Group; def arch : Separate<["-"], "arch">, MetaVarName<"">, HelpText<"The architecture (e.g. ppc, ppc64, i386, x86_64)">, Group; def o : Separate<["-"], "o">, MetaVarName<"">, HelpText<"The name of the output file (default: `a.out')">, Group; def grp_libs : OptionGroup<"libs">, HelpText<"LIBRARIES">; def l : Joined<["-"], "l">, MetaVarName<"">, HelpText<"Search for lib.dylib or lib.a on the library search path">, Group; def weak_l : Joined<["-"], "weak-l">, MetaVarName<"">, HelpText<"Like -l, but mark library and its references as weak imports">, Group; def weak_library : Separate<["-"], "weak_library">, MetaVarName<"">, HelpText<"Like bare , but mark library and its references as weak imports">, Group; def needed_l : Joined<["-"], "needed-l">, MetaVarName<"">, HelpText<"Like -l, but link library even if its symbols are not used and -dead_strip_dylibs is active">, Group; def needed_library : Separate<["-"], "needed_library">, MetaVarName<"">, HelpText<"Like bare , but link library even if its symbols are not used and -dead_strip_dylibs is active">, Group; def reexport_l : Joined<["-"], "reexport-l">, MetaVarName<"">, HelpText<"Like -l, but export all symbols of from newly created library">, Group; def reexport_library : Separate<["-"], "reexport_library">, MetaVarName<"">, HelpText<"Like bare , but export all symbols of from newly created library">, Group; def upward_l : Joined<["-"], "upward-l">, MetaVarName<"">, HelpText<"Like -l, but specify dylib as an upward dependency">, Flags<[HelpHidden]>, Group; def upward_library : Separate<["-"], "upward_library">, MetaVarName<"">, HelpText<"Like bare , but specify dylib as an upward dependency">, Flags<[HelpHidden]>, Group; def L : JoinedOrSeparate<["-"], "L">, MetaVarName<"">, HelpText<"Add dir to the library search path">, Group; def Z : Flag<["-"], "Z">, HelpText<"Remove standard directories from the library and framework search paths">, Group; def syslibroot : Separate<["-"], "syslibroot">, MetaVarName<"">, HelpText<"Prepend to all library and framework search paths">, Group; def search_paths_first : Flag<["-"], "search_paths_first">, HelpText<"Search for lib.dylib and lib.a at each step in traversing search path (default for Xcode 4 and later)">, Group; def search_dylibs_first : Flag<["-"], "search_dylibs_first">, HelpText<"Search for lib.dylib on first pass, then for lib.a on second pass through search path (default for Xcode 3 and earlier)">, Group; def framework : Separate<["-"], "framework">, MetaVarName<"">, HelpText<"Search for .framework/ on the framework search path">, Group; def weak_framework : Separate<["-"], "weak_framework">, MetaVarName<"">, HelpText<"Like -framework , but mark framework and its references as weak imports">, Group; def needed_framework : Separate<["-"], "needed_framework">, MetaVarName<"">, HelpText<"Like -framework , but link even if none of its symbols are used and -dead_strip_dylibs is active">, Group; def reexport_framework : Separate<["-"], "reexport_framework">, MetaVarName<"">, HelpText<"Like -framework , but export all symbols of from the newly created library">, Group; def upward_framework : Separate<["-"], "upward_framework">, MetaVarName<"">, HelpText<"Like -framework , but specify the framework as an upward dependency">, Flags<[HelpHidden]>, Group; def F : JoinedOrSeparate<["-"], "F">, MetaVarName<"">, HelpText<"Add dir to the framework search path">, Group; def all_load : Flag<["-"], "all_load">, HelpText<"Load all members of all static archive libraries">, Group; def ObjC : Flag<["-"], "ObjC">, HelpText<"Load all members of static archives that are an Objective-C class or category.">, Group; def force_load : Separate<["-"], "force_load">, MetaVarName<"">, HelpText<"Load all members static archive library at ">, Group; def force_load_swift_libs : Flag<["-"], "force_load_swift_libs">, HelpText<"Apply -force_load to libraries listed in LC_LINKER_OPTIONS whose names start with 'swift'">, Group; def grp_content : OptionGroup<"content">, HelpText<"ADDITIONAL CONTENT">; def sectcreate : MultiArg<["-"], "sectcreate", 3>, MetaVarName<"
">, HelpText<"Create
in from the contents of ">, Group; def segcreate : MultiArg<["-"], "segcreate", 3>, MetaVarName<"
">, Alias, HelpText<"Alias for -sectcreate">, Group; def filelist : Separate<["-"], "filelist">, MetaVarName<"">, HelpText<"Read names of files to link from ">, Group; def dtrace : Separate<["-"], "dtrace">, MetaVarName<"