1 include "llvm/Option/OptParser.td"
3 multiclass BB<string name, string help1, string help2> {
4 def NAME: Flag<["--"], name>, HelpText<help1>;
5 def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
8 // Flags that lld/MachO understands but ld64 doesn't. These take
9 // '--' instead of '-' and use dashes instead of underscores, so
10 // they don't collide with the ld64 compat options.
11 def grp_lld : OptionGroup<"kind">, HelpText<"LLD-SPECIFIC">;
13 def help : Flag<["-", "--"], "help">,
15 def help_hidden : Flag<["--"], "help-hidden">,
16 HelpText<"Display help for hidden options">,
18 def verbose : Flag<["--"], "verbose">,
20 def error_limit_eq : Joined<["--"], "error-limit=">,
21 HelpText<"Maximum number of errors to print before exiting (default: 20)">,
23 def color_diagnostics: Flag<["--"], "color-diagnostics">,
24 HelpText<"Alias for --color-diagnostics=always">,
26 def no_color_diagnostics: Flag<["--"], "no-color-diagnostics">,
27 HelpText<"Alias for --color-diagnostics=never">,
29 def color_diagnostics_eq: Joined<["--"], "color-diagnostics=">,
30 HelpText<"Use colors in diagnostics (default: auto)">,
31 MetaVarName<"[auto,always,never]">,
33 def threads_eq : Joined<["--"], "threads=">,
34 HelpText<"Number of threads. '1' disables multi-threading. By default all available hardware threads are used">,
36 def thinlto_emit_imports_files: Flag<["--"], "thinlto-emit-imports-files">,
38 def thinlto_emit_index_files: Flag<["--"], "thinlto-emit-index-files">,
40 def thinlto_index_only: Flag<["--"], "thinlto-index-only">,
42 def thinlto_index_only_eq: Joined<["--"], "thinlto-index-only=">,
44 def thinlto_jobs_eq : Joined<["--"], "thinlto-jobs=">,
45 HelpText<"Number of ThinLTO jobs. Default to --threads=">,
47 def thinlto_object_suffix_replace_eq:
48 Joined<["--"], "thinlto-object-suffix-replace=">,
50 def thinlto_prefix_replace_eq: Joined<["--"], "thinlto-prefix-replace=">,
52 def reproduce: Separate<["--"], "reproduce">,
54 def reproduce_eq: Joined<["--"], "reproduce=">,
55 Alias<!cast<Separate>(reproduce)>,
56 HelpText<"Write tar file containing inputs and command to reproduce link">,
58 def version: Flag<["--"], "version">,
59 HelpText<"Display the version number and exit">,
61 def time_trace_eq: Joined<["--"], "time-trace=">,
62 HelpText<"Record time trace to <file>">,
63 MetaVarName<"<file>">,
65 def : Flag<["--"], "time-trace">,
67 HelpText<"Record time trace to file next to output">,
69 def time_trace_granularity_eq: Joined<["--"], "time-trace-granularity=">,
70 HelpText<"Minimum time granularity (in microseconds) traced by time profiler">,
72 def deduplicate_strings: Flag<["--"], "deduplicate-strings">,
73 HelpText<"Enable string deduplication">,
75 def no_deduplicate_strings: Flag<["--"], "no-deduplicate-strings">,
76 HelpText<"Disable string deduplication. This helps uncover cases of comparing string addresses instead of equality and might have a link time performance benefit.">,
78 def dead_strip_duplicates: Flag<["--"], "dead-strip-duplicates">,
79 HelpText<"Do not error on duplicate symbols that will be dead stripped.">,
81 def print_dylib_search: Flag<["--"], "print-dylib-search">,
82 HelpText<"Print which paths lld searched when trying to find dylibs">,
84 def icf_eq: Joined<["--"], "icf=">,
85 HelpText<"Set level for identical code folding (default: none)">,
86 MetaVarName<"[none,safe,all]">,
88 def keep_icf_stabs: Joined<["--"], "keep-icf-stabs">,
89 HelpText<"Generate STABS entries for symbols folded by ICF. These entries can then be used by dsymutil to discover the address range where folded symbols are located.">,
91 def lto_O: Joined<["--"], "lto-O">,
92 HelpText<"Set optimization level for LTO (default: 2)">,
93 MetaVarName<"<opt-level>">,
95 def lto_CGO: Joined<["--"], "lto-CGO">,
96 HelpText<"Set codegen optimization level for LTO (default: 2)">,
97 MetaVarName<"<cgopt-level>">,
99 def thinlto_cache_policy_eq: Joined<["--"], "thinlto-cache-policy=">,
100 HelpText<"Pruning policy for the ThinLTO cache">,
102 def O : JoinedOrSeparate<["-"], "O">,
103 HelpText<"Optimize output file size">;
104 def start_lib: Flag<["--"], "start-lib">,
105 HelpText<"Start a grouping of objects that should be treated as if they were together in an archive">;
106 def end_lib: Flag<["--"], "end-lib">,
107 HelpText<"End a grouping of objects that should be treated as if they were together in an archive">;
108 def no_warn_dylib_install_name: Flag<["--"], "no-warn-dylib-install-name">,
109 HelpText<"Do not warn on -install_name if -dylib is not passed (default)">,
111 def warn_dylib_install_name: Flag<["--"], "warn-dylib-install-name">,
112 HelpText<"Warn on -install_name if -dylib is not passed">,
114 def warn_duplicate_rpath: Flag<["--"], "warn-duplicate-rpath">,
115 HelpText<"Warn if the same -rpath is specified multiple times (default)">,
117 def no_warn_duplicate_rpath: Flag<["--"], "no-warn-duplicate-rpath">,
118 HelpText<"Do not warn if the same -rpath is specified multiple times">,
120 def call_graph_profile_sort: Flag<["--"], "call-graph-profile-sort">,
121 HelpText<"Reorder sections with call graph profile (default)">,
123 def no_call_graph_profile_sort : Flag<["--"], "no-call-graph-profile-sort">,
124 HelpText<"Do not reorder sections with call graph profile">,
126 def print_symbol_order_eq: Joined<["--"], "print-symbol-order=">,
127 HelpText<"Print a symbol order specified by --call-graph-profile-sort into the specified file">,
129 def ignore_auto_link_option : Separate<["--"], "ignore-auto-link-option">,
131 def ignore_auto_link_option_eq : Joined<["--"], "ignore-auto-link-option=">,
132 Alias<!cast<Separate>(ignore_auto_link_option)>,
133 HelpText<"Ignore a single auto-linked library or framework. Useful to ignore invalid options that ld64 ignores">,
135 def strict_auto_link : Flag<["--"], "strict-auto-link">,
136 HelpText<"Always warn for missing frameworks or libraries if they are loaded via LC_LINKER_OPTIONS">,
138 def check_category_conflicts : Flag<["--"], "check-category-conflicts">,
139 HelpText<"Check for conflicts between category & class methods">,
141 def objc_category_merging : Flag<["-"], "objc_category_merging">,
142 HelpText<"Merge Objective-C categories that share the same base class">,
144 def no_objc_category_merging : Flag<["-"], "no_objc_category_merging">,
145 HelpText<"Do not merge Objective-C categories">,
147 def lto_debug_pass_manager: Flag<["--"], "lto-debug-pass-manager">,
148 HelpText<"Debug new pass manager">, Group<grp_lld>;
149 def cs_profile_generate: Flag<["--"], "cs-profile-generate">,
150 HelpText<"Perform context sensitive PGO instrumentation">, Group<grp_lld>;
151 def cs_profile_path: Joined<["--"], "cs-profile-path=">,
152 HelpText<"Context sensitive profile file path">, Group<grp_lld>;
153 defm pgo_warn_mismatch: BB<"pgo-warn-mismatch",
154 "turn on warnings about profile cfg mismatch (default)",
155 "turn off warnings about profile cfg mismatch">, Group<grp_lld>;
156 defm warn_thin_archive_missing_members : BB<"warn-thin-archive-missing-members",
157 "Warn on missing object files referenced by thin archives (default)",
158 "Do not warn on missing object files referenced by thin archives">, Group<grp_lld>;
160 // This is a complete Options.td compiled from Apple's ld(1) manpage
161 // dated 2018-03-07 and cross checked with ld64 source code in repo
162 // https://github.com/apple-opensource/ld64 at git tag "512.4" dated
165 // Flags<[HelpHidden]> marks options that are not yet ported to lld,
166 // and serve as a scoreboard for annotating our progress toward
167 // implementing ld64 options in lld. As you add implementions to
168 // Driver.cpp, please remove the hidden flag here.
170 def grp_kind : OptionGroup<"kind">, HelpText<"OUTPUT KIND">;
172 def execute : Flag<["-"], "execute">,
173 HelpText<"Produce a main executable (default)">,
175 def dylib : Flag<["-"], "dylib">,
176 HelpText<"Produce a shared library">,
178 def bundle : Flag<["-"], "bundle">,
179 HelpText<"Produce a bundle">,
181 def r : Flag<["-"], "r">,
182 HelpText<"Merge multiple object files into one, retaining relocations">,
185 def dylinker : Flag<["-"], "dylinker">,
186 HelpText<"Produce a dylinker only used when building dyld">,
189 def dynamic : Flag<["-"], "dynamic">,
190 HelpText<"Link dynamically (default)">,
192 def static : Flag<["-"], "static">,
193 HelpText<"Link statically">,
196 def preload : Flag<["-"], "preload">,
197 HelpText<"Produce an unsegmented binary for embedded systems">,
200 def arch : Separate<["-"], "arch">,
201 MetaVarName<"<arch_name>">,
202 HelpText<"The architecture (e.g. ppc, ppc64, i386, x86_64)">,
204 def o : Separate<["-"], "o">,
205 MetaVarName<"<path>">,
206 HelpText<"The name of the output file (default: `a.out')">,
209 def grp_libs : OptionGroup<"libs">, HelpText<"LIBRARIES">;
211 def l : Joined<["-"], "l">,
212 MetaVarName<"<name>">,
213 HelpText<"Search for lib<name>.dylib or lib<name>.a on the library search path">,
215 def weak_l : Joined<["-"], "weak-l">,
216 MetaVarName<"<name>">,
217 HelpText<"Like -l<name>, but mark library and its references as weak imports">,
219 def weak_library : Separate<["-"], "weak_library">,
220 MetaVarName<"<path>">,
221 HelpText<"Like bare <path>, but mark library and its references as weak imports">,
223 def needed_l : Joined<["-"], "needed-l">,
224 MetaVarName<"<name>">,
225 HelpText<"Like -l<name>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
227 def needed_library : Separate<["-"], "needed_library">,
228 MetaVarName<"<path>">,
229 HelpText<"Like bare <path>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
231 def reexport_l : Joined<["-"], "reexport-l">,
232 MetaVarName<"<name>">,
233 HelpText<"Like -l<name>, but export all symbols of <name> from newly created library">,
235 def reexport_library : Separate<["-"], "reexport_library">,
236 MetaVarName<"<path>">,
237 HelpText<"Like bare <path>, but export all symbols of <path> from newly created library">,
239 def upward_l : Joined<["-"], "upward-l">,
240 MetaVarName<"<name>">,
241 HelpText<"Like -l<name>, but specify dylib as an upward dependency">,
244 def upward_library : Separate<["-"], "upward_library">,
245 MetaVarName<"<path>">,
246 HelpText<"Like bare <path>, but specify dylib as an upward dependency">,
249 def L : JoinedOrSeparate<["-"], "L">,
250 MetaVarName<"<dir>">,
251 HelpText<"Add dir to the library search path">,
253 def Z : Flag<["-"], "Z">,
254 HelpText<"Remove standard directories from the library and framework search paths">,
256 def syslibroot : Separate<["-"], "syslibroot">,
257 MetaVarName<"<rootdir>">,
258 HelpText<"Prepend <rootdir> to all library and framework search paths">,
260 def search_paths_first : Flag<["-"], "search_paths_first">,
261 HelpText<"Search for lib<name>.dylib and lib<name>.a at each step in traversing search path (default for Xcode 4 and later)">,
263 def search_dylibs_first : Flag<["-"], "search_dylibs_first">,
264 HelpText<"Search for lib<name>.dylib on first pass, then for lib<name>.a on second pass through search path (default for Xcode 3 and earlier)">,
266 def framework : Separate<["-"], "framework">,
267 MetaVarName<"<name>">,
268 HelpText<"Search for <name>.framework/<name> on the framework search path">,
270 def weak_framework : Separate<["-"], "weak_framework">,
271 MetaVarName<"<name>">,
272 HelpText<"Like -framework <name>, but mark framework and its references as weak imports">,
274 def needed_framework : Separate<["-"], "needed_framework">,
275 MetaVarName<"<name>">,
276 HelpText<"Like -framework <name>, but link <name> even if none of its symbols are used and -dead_strip_dylibs is active">,
278 def reexport_framework : Separate<["-"], "reexport_framework">,
279 MetaVarName<"<name>">,
280 HelpText<"Like -framework <name>, but export all symbols of <name> from the newly created library">,
282 def upward_framework : Separate<["-"], "upward_framework">,
283 MetaVarName<"<name>">,
284 HelpText<"Like -framework <name>, but specify the framework as an upward dependency">,
287 def F : JoinedOrSeparate<["-"], "F">,
288 MetaVarName<"<dir>">,
289 HelpText<"Add dir to the framework search path">,
291 def all_load : Flag<["-"], "all_load">,
292 HelpText<"Load all members of all static archive libraries">,
294 def noall_load : Flag<["-"], "noall_load">,
295 HelpText<"Don't load all static members from archives, this is the default, this negates -all_load">,
297 def ObjC : Flag<["-"], "ObjC">,
298 HelpText<"Load all members of static archives that are an Objective-C class or category.">,
300 def force_load : Separate<["-"], "force_load">,
301 MetaVarName<"<path>">,
302 HelpText<"Load all members static archive library at <path>">,
304 def force_load_swift_libs : Flag<["-"], "force_load_swift_libs">,
305 HelpText<"Apply -force_load to libraries listed in LC_LINKER_OPTIONS whose names start with 'swift'">,
307 def load_hidden : Separate<["-"], "load_hidden">,
308 MetaVarName<"<path>">,
309 HelpText<"Load all symbols from static library with hidden visibility">,
311 def hidden_l : Joined<["-"], "hidden-l">,
312 MetaVarName<"<name>">,
313 HelpText<"Like -l<name>, but load all symbols with hidden visibility">,
316 def grp_content : OptionGroup<"content">, HelpText<"ADDITIONAL CONTENT">;
318 def sectcreate : MultiArg<["-"], "sectcreate", 3>,
319 MetaVarName<"<segment> <section> <file>">,
320 HelpText<"Create <section> in <segment> from the contents of <file>">,
322 def segcreate : MultiArg<["-"], "segcreate", 3>,
323 MetaVarName<"<segment> <section> <file>">,
325 HelpText<"Alias for -sectcreate">,
327 def add_empty_section : MultiArg<["-"], "add_empty_section", 2>,
328 MetaVarName<"<segment> <section>">,
329 HelpText<"Create an empty <section> in <segment>">,
331 def filelist : Separate<["-"], "filelist">,
332 MetaVarName<"<file>">,
333 HelpText<"Read names of files to link from <file>">,
335 def dtrace : Separate<["-"], "dtrace">,
336 MetaVarName<"<script>">,
337 HelpText<"Enable DTrace static probes according to declarations in <script>">,
341 def grp_opts : OptionGroup<"opts">, HelpText<"OPTIMIZATIONS">;
343 def dead_strip : Flag<["-"], "dead_strip">,
344 HelpText<"Remove unreachable functions and data">,
346 def order_file : Separate<["-"], "order_file">,
347 MetaVarName<"<file>">,
348 HelpText<"Layout functions and data according to specification in <file>">,
350 def no_order_inits : Flag<["-"], "no_order_inits">,
351 HelpText<"Disable default reordering of initializer and terminator functions">,
354 def no_order_data : Flag<["-"], "no_order_data">,
355 HelpText<"Disable default reordering of global data accessed at launch time">,
358 def image_base : Separate<["-"], "image_base">,
359 MetaVarName<"<address>">,
360 HelpText<"Preferred hex load address for a dylib or bundle.">,
363 def seg1addr : Separate<["-"], "seg1addr">,
364 MetaVarName<"<address>">,
366 HelpText<"Alias for -image_base">,
369 def no_implicit_dylibs : Flag<["-"], "no_implicit_dylibs">,
370 HelpText<"Do not optimize public dylib transitive symbol references">,
372 def exported_symbols_order : Separate<["-"], "exported_symbols_order">,
373 MetaVarName<"<file>">,
374 HelpText<"Specify frequently-used symbols in <file> to optimize symbol exports">,
377 def no_zero_fill_sections : Flag<["-"], "no_zero_fill_sections">,
378 HelpText<"Explicitly store zeroed data in the final image">,
381 def merge_zero_fill_sections : Flag<["-"], "merge_zero_fill_sections">,
382 HelpText<"Merge all zeroed data into the __zerofill section">,
385 def no_branch_islands : Flag<["-"], "no_branch_islands">,
386 HelpText<"Disable infra for branches beyond the maximum branch distance.">,
389 def no_deduplicate : Flag<["-"], "no_deduplicate">,
390 HelpText<"Disable code deduplication (synonym for `--icf=none')">,
391 Alias<icf_eq>, AliasArgs<["none"]>,
394 def grp_version : OptionGroup<"version">, HelpText<"VERSION TARGETING">;
396 def platform_version : MultiArg<["-"], "platform_version", 3>,
397 MetaVarName<"<platform> <min_version> <sdk_version>">,
398 HelpText<"Platform (e.g., macos, ios, tvos, watchos, xros, bridgeos, mac-catalyst, ios-sim, tvos-sim, watchos-sim, xros-sim, driverkit) and version numbers">,
400 def sdk_version : Separate<["-"], "sdk_version">,
401 HelpText<"This option is undocumented in ld64">,
404 def macos_version_min : Separate<["-"], "macos_version_min">,
405 MetaVarName<"<version>">,
406 HelpText<"Oldest macOS version for which linked output is usable">,
408 def macosx_version_min : Separate<["-"], "macosx_version_min">,
409 MetaVarName<"<version>">,
410 Alias<macos_version_min>,
411 HelpText<"Alias for -macos_version_min">,
414 def ios_version_min : Separate<["-"], "ios_version_min">,
415 MetaVarName<"<version>">,
416 HelpText<"Oldest iOS version for which linked output is usable">,
419 def ios_simulator_version_min : Separate<["-"], "ios_simulator_version_min">,
420 MetaVarName<"<version>">,
421 HelpText<"Oldest iOS simulator version for which linked output is usable">,
424 def iphoneos_version_min : Separate<["-"], "iphoneos_version_min">,
425 MetaVarName<"<version>">,
426 Alias<ios_version_min>,
427 HelpText<"Alias for -ios_version_min">,
430 def maccatalyst_version_min : Separate<["-"], "maccatalyst_version_min">,
431 MetaVarName<"<version>">,
432 HelpText<"Oldest MacCatalyst version for which linked output is usable">,
435 def iosmac_version_min : Separate<["-"], "iosmac_version_min">,
436 MetaVarName<"<version>">,
437 Alias<maccatalyst_version_min>,
438 HelpText<"Alias for -maccatalyst_version_min">,
441 def uikitformac_version_min : Separate<["-"], "uikitformac_version_min">,
442 MetaVarName<"<version>">,
443 Alias<maccatalyst_version_min>,
444 HelpText<"Alias for -maccatalyst_version_min">,
447 def tvos_version_min : Separate<["-"], "tvos_version_min">,
448 MetaVarName<"<version>">,
449 HelpText<"Oldest tvOS version for which linked output is usable">,
452 def watchos_version_min : Separate<["-"], "watchos_version_min">,
453 MetaVarName<"<version>">,
454 HelpText<"Oldest watchOS version for which linked output is usable">,
457 def bridgeos_version_min : Separate<["-"], "bridgeos_version_min">,
458 MetaVarName<"<version>">,
459 HelpText<"Oldest bridgeOS version for which linked output is usable">,
462 def driverkit_version_min : Separate<["-"], "driverkit_version_min">,
463 MetaVarName<"<version>">,
464 HelpText<"Oldest DriverKit version for which linked output is usable">,
468 def grp_dylib : OptionGroup<"dylib">, HelpText<"DYNAMIC LIBRARIES (DYLIB)">;
470 def install_name : Separate<["-"], "install_name">,
471 MetaVarName<"<name>">,
472 HelpText<"Set an internal install path in a dylib">,
474 def dylib_install_name : Separate<["-"], "dylib_install_name">,
475 MetaVarName<"<name>">,
477 HelpText<"Alias for -install_name">,
479 def dylinker_install_name : Separate<["-"], "dylinker_install_name">,
480 MetaVarName<"<name>">,
482 HelpText<"Alias for -install_name">,
484 def mark_dead_strippable_dylib : Flag<["-"], "mark_dead_strippable_dylib">,
485 HelpText<"Mark output dylib as dead-strippable: When a client links against it but does not use any of its symbols, the dylib will not be added to the client's list of needed dylibs">,
487 def compatibility_version : Separate<["-"], "compatibility_version">,
488 MetaVarName<"<version>">,
489 HelpText<"Compatibility <version> of this library">,
491 def dylib_compatibility_version : Separate<["-"], "dylib_compatibility_version">,
492 MetaVarName<"<version>">,
493 Alias<compatibility_version>,
494 HelpText<"Alias for -compatibility_version">,
497 def current_version : Separate<["-"], "current_version">,
498 MetaVarName<"<version>">,
499 HelpText<"Current <version> of this library">,
501 def dylib_current_version : Separate<["-"], "dylib_current_version">,
502 MetaVarName<"<version>">,
503 Alias<current_version>,
504 HelpText<"Alias for -current_version">,
508 def grp_main : OptionGroup<"main">, HelpText<"MAIN EXECUTABLE">;
510 def pie : Flag<["-"], "pie">,
511 HelpText<"Build a position independent executable (default)">,
513 def no_pie : Flag<["-"], "no_pie">,
514 HelpText<"Do not build a position independent executable">,
516 def pagezero_size : Separate<["-"], "pagezero_size">,
517 MetaVarName<"<size>">,
518 HelpText<"Size of unreadable segment at address zero is hex <size> (default is 4KB on 32-bit and 4GB on 64-bit)">,
520 def stack_size : Separate<["-"], "stack_size">,
521 MetaVarName<"<size>">,
522 HelpText<"Maximum hex stack size for the main thread in a program. (default is 8MB)">,
525 def allow_stack_execute : Flag<["-"], "allow_stack_execute">,
526 HelpText<"Mark stack segment as executable">,
529 def export_dynamic : Flag<["-"], "export_dynamic">,
530 HelpText<"Preserve all global symbols during LTO and when dead-stripping executables">,
533 def grp_bundle : OptionGroup<"bundle">, HelpText<"CREATING A BUNDLE">;
535 def bundle_loader : Separate<["-"], "bundle_loader">,
536 MetaVarName<"<executable>">,
537 HelpText<"Resolve undefined symbols from <executable>">,
540 def grp_object : OptionGroup<"object">, HelpText<"CREATING AN OBJECT FILE">;
542 def keep_private_externs : Flag<["-"], "keep_private_externs">,
543 HelpText<"Do not convert private external symbols to static symbols (only valid with -r)">,
546 def d : Flag<["-"], "d">,
547 HelpText<"Force tentative into real definitions for common symbols">,
551 def grp_resolve : OptionGroup<"resolve">, HelpText<"SYMBOL RESOLUTION">;
553 def exported_symbol : Separate<["-"], "exported_symbol">,
554 MetaVarName<"<symbol>">,
555 HelpText<"<symbol> remains global, while others become private externs">,
557 def exported_symbols_list : Separate<["-"], "exported_symbols_list">,
558 MetaVarName<"<file>">,
559 HelpText<"Symbols specified in <file> remain global, while others become private externs">,
561 def no_exported_symbols : Flag<["-"], "no_exported_symbols">,
562 HelpText<"Don't export any symbols from the binary, useful for main executables that don't have plugins">,
564 def unexported_symbol : Separate<["-"], "unexported_symbol">,
565 MetaVarName<"<symbol>">,
566 HelpText<"Global <symbol> becomes private extern">,
568 def unexported_symbols_list : Separate<["-"], "unexported_symbols_list">,
569 MetaVarName<"<file>">,
570 HelpText<"Global symbols specified in <file> become private externs">,
572 def reexported_symbols_list : Separate<["-"], "reexported_symbols_list">,
573 MetaVarName<"<file>">,
574 HelpText<"Symbols from dependent dylibs specified in <file> are reexported by this dylib">,
577 def alias : MultiArg<["-"], "alias", 2>,
578 MetaVarName<"<symbol_name> <alternate_name>">,
579 HelpText<"Create a symbol alias with default global visibility">,
581 def alias_list : Separate<["-"], "alias_list">,
582 MetaVarName<"<file>">,
583 HelpText<"Create symbol aliases specified in <file>">,
586 def flat_namespace : Flag<["-"], "flat_namespace">,
587 HelpText<"Resolve symbols from all dylibs, both direct and transitive. Do not record source libraries: dyld must re-search at runtime and use the first definition found">,
589 def twolevel_namespace : Flag<["-"], "twolevel_namespace">,
590 HelpText<"Make dyld look up symbols by (dylib,name) pairs (default)">,
592 def u : Separate<["-"], "u">,
593 MetaVarName<"<symbol>">,
594 HelpText<"Require that <symbol> be defined for the link to succeed">,
596 def U : Separate<["-"], "U">,
597 MetaVarName<"<symbol>">,
598 HelpText<"Allow <symbol> to have no definition">,
600 def undefined : Separate<["-"], "undefined">,
601 MetaVarName<"<treatment>">,
602 HelpText<"Handle undefined symbols according to <treatment>: error, warning, suppress, or dynamic_lookup (default is error)">,
604 def rpath : Separate<["-"], "rpath">,
605 MetaVarName<"<path>">,
606 HelpText<"Add <path> to dyld search list for dylibs with load path prefix `@rpath/'">,
608 def commons : Separate<["-"], "commons">,
609 MetaVarName<"<treatment>">,
610 HelpText<"Resolve tentative definitions in dylibs according to <treatment>: ignore_dylibs, use_dylibs, error (default is ignore_dylibs)">,
614 def grp_introspect : OptionGroup<"introspect">, HelpText<"INTROSPECTING THE LINKER">;
616 def why_load : Flag<["-"], "why_load">,
617 HelpText<"Log why each object file is loaded from a static library">,
618 Group<grp_introspect>;
619 def whyload : Flag<["-"], "whyload">,
621 HelpText<"Alias for -why_load">,
622 Group<grp_introspect>;
623 def why_live : Separate<["-"], "why_live">,
624 MetaVarName<"<symbol>">,
625 HelpText<"Log a chain of references to <symbol>, for use with -dead_strip">,
626 Group<grp_introspect>;
627 def print_statistics : Flag<["-"], "print_statistics">,
628 HelpText<"Log the linker's memory and CPU usage">,
630 Group<grp_introspect>;
631 def t : Flag<["-"], "t">,
632 HelpText<"Log every file the linker loads: object, archive, and dylib">,
633 Group<grp_introspect>;
634 def whatsloaded : Flag<["-"], "whatsloaded">,
635 HelpText<"Logs only the object files the linker loads">,
637 Group<grp_introspect>;
638 def order_file_statistics : Flag<["-"], "order_file_statistics">,
639 HelpText<"Logs information about -order_file">,
641 Group<grp_introspect>;
642 def map : Separate<["-"], "map">,
643 MetaVarName<"<path>">,
644 HelpText<"Writes all symbols and their addresses to <path>">,
645 Group<grp_introspect>;
646 def dependency_info : Separate<["-"], "dependency_info">,
647 MetaVarName<"<path>">,
648 HelpText<"Dump dependency info">,
649 Group<grp_introspect>;
650 def save_temps : Flag<["-"], "save-temps">,
651 HelpText<"Save intermediate LTO compilation results">,
652 Group<grp_introspect>;
654 def grp_symtab : OptionGroup<"symtab">, HelpText<"SYMBOL TABLE">;
656 def S : Flag<["-"], "S">,
657 HelpText<"Strip debug information (STABS or DWARF) from the output">,
659 def x : Flag<["-"], "x">,
660 HelpText<"Exclude non-global symbols from the output symbol table">,
662 def non_global_symbols_strip_list : Separate<["-"], "non_global_symbols_strip_list">,
663 MetaVarName<"<path>">,
664 HelpText<"Specify in <path> the non-global symbols that should be removed from the output symbol table">,
666 def non_global_symbols_no_strip_list : Separate<["-"], "non_global_symbols_no_strip_list">,
667 MetaVarName<"<path>">,
668 HelpText<"Specify in <path> the non-global symbols that should remain in the output symbol table">,
670 def oso_prefix : Separate<["-"], "oso_prefix">,
671 MetaVarName<"<path>">,
672 HelpText<"Remove the prefix <path> from OSO symbols in the debug map">,
674 def add_ast_path : Separate<["-"], "add_ast_path">,
675 MetaVarName<"<path>">,
676 HelpText<"AST paths will be emitted as STABS">,
679 def grp_rare : OptionGroup<"rare">, HelpText<"RARELY USED">;
681 def v : Flag<["-"], "v">,
682 HelpText<"Print the linker version and search paths in addition to linking">,
684 def adhoc_codesign : Flag<["-"], "adhoc_codesign">,
685 HelpText<"Write an ad-hoc code signature to the output file (default for arm64 binaries)">,
687 def no_adhoc_codesign : Flag<["-"], "no_adhoc_codesign">,
688 HelpText<"Do not write an ad-hoc code signature to the output file (default for x86_64 binaries)">,
690 def reproducible : Flag<["-"], "reproducible">,
691 HelpText<"Make the output reproducible by removing timestamps and other non-deterministic data. This is the default behavior.">,
693 def version_details : Flag<["-"], "version_details">,
694 HelpText<"Print the linker version in JSON form">,
697 def no_weak_imports : Flag<["-"], "no_weak_imports">,
698 HelpText<"Fail if any symbols are weak imports, allowed to be NULL at runtime">,
701 def verbose_deduplicate : Flag<["-"], "verbose_deduplicate">,
702 HelpText<"Print function names eliminated by deduplication and the total size of code savings">,
705 def no_inits : Flag<["-"], "no_inits">,
706 HelpText<"Fail if the output contains static initializers">,
709 def no_warn_inits : Flag<["-"], "no_warn_inits">,
710 HelpText<"Suppress warnings for static initializers in the output">,
713 def unaligned_pointers : Separate<["-"], "unaligned_pointers">,
714 MetaVarName<"<treatment>">,
715 HelpText<"Handle unaligned pointers in __DATA segments according to <treatment>: warning, error, or suppress (default for arm64e is error, otherwise suppress)">,
718 def dirty_data_list : Separate<["-"], "dirty_data_list">,
719 MetaVarName<"<path>">,
720 HelpText<"Specify data symbols in <path> destined for the __DATA_DIRTY segment">,
723 def max_default_common_align : Separate<["-"], "max_default_common_align">,
724 MetaVarName<"<boundary>">,
725 HelpText<"Reduce maximum alignment for common symbols to a hex power-of-2 <boundary>">,
728 def move_to_rw_segment : MultiArg<["-"], "move_to_rw_segment", 2>,
729 MetaVarName<"<segment> <path>">,
730 HelpText<"Move data symbols listed in <path> to another <segment>">,
733 def move_to_ro_segment : MultiArg<["-"], "move_to_ro_segment", 2>,
734 MetaVarName<"<segment> <path>">,
735 HelpText<"Move code symbols listed in <path> to another <segment>">,
738 def rename_section : MultiArg<["-"], "rename_section", 4>,
739 MetaVarName<"<from_segment> <from_section> <to_segment> <to_section>">,
740 HelpText<"Rename <from_segment>/<from_section> as <to_segment>/<to_section>">,
742 def rename_segment : MultiArg<["-"], "rename_segment", 2>,
743 MetaVarName<"<from_segment> <to_segment>">,
744 HelpText<"Rename <from_segment> as <to_segment>">,
746 def trace_symbol_layout : Flag<["-"], "trace_symbol_layout">,
747 HelpText<"Show where and why symbols move, as specified by -move_to_ro_segment, -move_to_rw_segment, -rename_section, and -rename_segment">,
750 def data_const : Flag<["-"], "data_const">,
751 HelpText<"Force migration of readonly data into __DATA_CONST segment">,
753 def no_data_const : Flag<["-"], "no_data_const">,
754 HelpText<"Block migration of readonly data away from __DATA segment">,
756 def text_exec : Flag<["-"], "text_exec">,
757 HelpText<"Rename __segment TEXT to __TEXT_EXEC for sections __text and __stubs">,
760 def section_order : MultiArg<["-"], "section_order", 2>,
761 MetaVarName<"<segment> <sections>">,
762 HelpText<"With -preload, specify layout sequence of colon-separated <sections> in <segment>">,
765 def segment_order : Separate<["-"], "segment_order">,
766 MetaVarName<"<colon_separated_segment_list>">,
767 HelpText<"With -preload, specify layout sequence of colon-separated <segments>">,
770 def allow_heap_execute : Flag<["-"], "allow_heap_execute">,
771 HelpText<"On i386, allow any page to execute code">,
774 def application_extension : Flag<["-"], "application_extension">,
775 HelpText<"Mark output as safe for use in an application extension, and validate that linked dylibs are safe">,
777 def no_application_extension : Flag<["-"], "no_application_extension">,
778 HelpText<"Disable application extension functionality (default)">,
780 def fatal_warnings : Flag<["-"], "fatal_warnings">,
781 HelpText<"Treat warnings as errors">,
783 def no_eh_labels : Flag<["-"], "no_eh_labels">,
784 HelpText<"In -r mode, suppress .eh labels in the __eh_frame section">,
787 def warn_compact_unwind : Flag<["-"], "warn_compact_unwind">,
788 HelpText<"Warn for each FDE that cannot compact into the __unwind_info section and must remain in the __eh_frame section">,
791 def warn_weak_exports : Flag<["-"], "warn_weak_exports">,
792 HelpText<"Warn if the linked image contains weak external symbols">,
795 def no_weak_exports : Flag<["-"], "no_weak_exports">,
796 HelpText<"Fail if the linked image contains weak external symbols">,
799 def objc_gc_compaction : Flag<["-"], "objc_gc_compaction">,
800 HelpText<"Mark the Objective-C image as compatible with compacting garbage collection">,
803 def objc_gc : Flag<["-"], "objc_gc">,
804 HelpText<"Verify that all code was compiled with -fobjc-gc or -fobjc-gc-only">,
807 def objc_gc_only : Flag<["-"], "objc_gc_only">,
808 HelpText<"Verify that all code was compiled with -fobjc-gc-only">,
811 def dead_strip_dylibs : Flag<["-"], "dead_strip_dylibs">,
812 HelpText<"Remove dylibs that are unreachable by the entry point or exported symbols">,
814 def allow_sub_type_mismatches : Flag<["-"], "allow_sub_type_mismatches">,
815 HelpText<"Permit mixing objects compiled for different ARM CPU subtypes">,
818 def no_uuid : Flag<["-"], "no_uuid">,
819 HelpText<"Do not generate the LC_UUID load command">,
821 def root_safe : Flag<["-"], "root_safe">,
822 HelpText<"Set the MH_ROOT_SAFE bit in the mach-o header">,
825 def setuid_safe : Flag<["-"], "setuid_safe">,
826 HelpText<"Set the MH_SETUID_SAFE bit in the mach-o header">,
829 def interposable : Flag<["-"], "interposable">,
830 HelpText<"Indirects access to all to exported symbols in a dylib">,
833 def multi_module : Flag<["-"], "multi_module">,
835 HelpText<"Alias for -interposable">,
838 def init : Separate<["-"], "init">,
839 MetaVarName<"<symbol>">,
840 HelpText<"Run <symbol> as the first initializer in a dylib">,
843 def sub_library : Separate<["-"], "sub_library">,
844 MetaVarName<"<name>">,
845 HelpText<"Re-export the dylib as <name>">,
847 def sub_umbrella : Separate<["-"], "sub_umbrella">,
848 MetaVarName<"<name>">,
849 HelpText<"Re-export the framework as <name>">,
851 def allowable_client : Separate<["-"], "allowable_client">,
852 MetaVarName<"<name>">,
853 HelpText<"Specify <name> of a dylib or framework that is allowed to link to this dylib">,
856 def client_name : Separate<["-"], "client_name">,
857 MetaVarName<"<name>">,
858 HelpText<"Specifies a <name> this client should match with the -allowable_client <name> in a dependent dylib">,
861 def umbrella : Separate<["-"], "umbrella">,
862 MetaVarName<"<name>">,
863 HelpText<"Re-export this dylib through the umbrella framework <name>">,
865 def headerpad : Separate<["-"], "headerpad">,
866 MetaVarName<"<size>">,
867 HelpText<"Allocate hex <size> extra space for future expansion of the load commands via install_name_tool (default is 0x20)">,
869 def headerpad_max_install_names : Flag<["-"], "headerpad_max_install_names">,
870 HelpText<"Allocate extra space so all load-command paths can expand to MAXPATHLEN via install_name_tool">,
872 def bind_at_load : Flag<["-"], "bind_at_load">,
873 HelpText<"Tell dyld to bind all symbols at load time, rather than lazily">,
876 def force_flat_namespace : Flag<["-"], "force_flat_namespace">,
877 HelpText<"Tell dyld to use a flat namespace on this executable and all its dependent dylibs & bundles">,
880 def segalign : Separate<["-"], "segalign">,
881 MetaVarName<"<boundary>">,
882 HelpText<"Align all segments to hex power-of-2 <boundary>">,
885 def sectalign : MultiArg<["-"], "sectalign", 3>,
886 MetaVarName<"<segment> <section> <boundary>">,
887 HelpText<"Align <section> within <segment> to hex power-of-2 <boundary>">,
889 def stack_addr : Separate<["-"], "stack_addr">,
890 MetaVarName<"<address>">,
891 HelpText<"Initialize stack pointer to hex <address> rounded to a page boundary">,
894 def segprot : MultiArg<["-"], "segprot", 3>,
895 MetaVarName<"<segment> <max> <init>">,
896 HelpText<"Specifies the <max> and <init> virtual memory protection of <segment> as r/w/x/-seg_addr_table path">,
898 def segs_read_write_addr : Separate<["-"], "segs_read_write_addr">,
899 MetaVarName<"<address>">,
900 HelpText<"This option is obsolete">,
903 def segs_read_only_addr : Separate<["-"], "segs_read_only_addr">,
904 MetaVarName<"<address>">,
905 HelpText<"This option is obsolete">,
908 def segaddr : MultiArg<["-"], "segaddr", 2>,
909 MetaVarName<"<segment> <address>">,
910 HelpText<"Specify the starting hex <address> at a 4KiB page boundary for <segment>">,
913 def seg_page_size : MultiArg<["-"], "seg_page_size", 2>,
914 MetaVarName<"<segment> <size>">,
915 HelpText<"Specifies the page <size> for <segment>. Segment size will be a multiple of its page size">,
918 def dylib_file : Separate<["-"], "dylib_file">,
919 MetaVarName<"<install_path:current_path>">,
920 HelpText<"Specify <current_path> as different from where a dylib normally resides at <install_path>">,
923 def weak_reference_mismatches : Separate<["-"], "weak_reference_mismatches">,
924 MetaVarName<"<treatment>">,
925 HelpText<"Resolve symbol imports of conflicting weakness according to <treatment> as weak, non-weak, or error (default is non-weak)">,
928 def read_only_relocs : Separate<["-"], "read_only_relocs">,
929 MetaVarName<"<treatment>">,
930 HelpText<"Handle relocations that modify read-only pages according to <treatment> of warning, error, or suppress (i.e., allow)">,
933 def force_cpusubtype_ALL : Flag<["-"], "force_cpusubtype_ALL">,
934 HelpText<"Mark binary as runnable on any PowerPC, ignoring any PowerPC cpu requirements encoded in the object files">,
937 def no_arch_warnings : Flag<["-"], "no_arch_warnings">,
938 HelpText<"Suppresses warnings about inputs whose architecture does not match the -arch option">,
941 def arch_errors_fatal : Flag<["-"], "arch_errors_fatal">,
942 HelpText<"Escalate to errors any warnings about inputs whose architecture does not match the -arch option">,
944 def e : Separate<["-"], "e">,
945 MetaVarName<"<symbol>">,
946 HelpText<"Make <symbol> the entry point of an executable (default is \"start\" from crt1.o)">,
948 def w : Flag<["-"], "w">,
949 HelpText<"Suppress all warnings">,
951 def final_output : Separate<["-"], "final_output">,
952 MetaVarName<"<name>">,
953 HelpText<"Specify dylib install name if -install_name is not used; used by compiler driver for multiple -arch arguments">,
955 def arch_multiple : Flag<["-"], "arch_multiple">,
956 HelpText<"Augment error and warning messages with the architecture name">,
958 def dot : Separate<["-"], "dot">,
959 MetaVarName<"<path>">,
960 HelpText<"Write a graph of symbol dependencies to <path> as a .dot file viewable with GraphViz">,
963 def keep_relocs : Flag<["-"], "keep_relocs">,
964 HelpText<"Retain section-based relocation records in the output, which are ignored at runtime by dyld">,
967 def warn_stabs : Flag<["-"], "warn_stabs">,
968 HelpText<"Warn when bad stab symbols inside a BINCL/EINCL prevent optimization">,
971 def warn_commons : Flag<["-"], "warn_commons">,
972 HelpText<"Warn when a tentative definition in an object file matches an external symbol in a dylib, which often means \"extern\" is missing from a variable declaration in a header file">,
975 def read_only_stubs : Flag<["-"], "read_only_stubs">,
976 HelpText<"On i386, make the __IMPORT segment of a final linked image read-only">,
979 def interposable_list : Separate<["-"], "interposable_list">,
980 MetaVarName<"<path>">,
981 HelpText<"Access global symbols listed in <path> indirectly">,
984 def no_function_starts : Flag<["-"], "no_function_starts">,
985 HelpText<"Do not create table of function start addresses">,
987 def object_path_lto : Separate<["-"], "object_path_lto">,
988 MetaVarName<"<path>">,
989 HelpText<"Retain any temporary mach-o file in <path> that would otherwise be deleted during LTO">,
991 def cache_path_lto : Separate<["-"], "cache_path_lto">,
992 MetaVarName<"<path>">,
993 HelpText<"Use <path> as a directory for the incremental LTO cache">,
995 def prune_interval_lto : Separate<["-"], "prune_interval_lto">,
996 MetaVarName<"<seconds>">,
997 HelpText<"Prune the incremental LTO cache after <seconds> (-1 disables pruning)">,
999 def prune_after_lto : Separate<["-"], "prune_after_lto">,
1000 MetaVarName<"<seconds>">,
1001 HelpText<"Remove LTO cache entries after <seconds>">,
1003 def max_relative_cache_size_lto : Separate<["-"], "max_relative_cache_size_lto">,
1004 MetaVarName<"<percent>">,
1005 HelpText<"Limit the incremental LTO cache growth to <percent> of free disk, space">,
1007 def page_align_data_atoms : Flag<["-"], "page_align_data_atoms">,
1008 HelpText<"Distribute global variables on separate pages so page used/dirty status can guide creation of an order file to cluster commonly used/dirty globals">,
1009 Flags<[HelpHidden]>,
1011 def not_for_dyld_shared_cache : Flag<["-"], "not_for_dyld_shared_cache">,
1012 HelpText<"Prevent system dylibs from being placed into the dylib shared cache">,
1013 Flags<[HelpHidden]>,
1015 def mllvm : Separate<["-"], "mllvm">,
1016 HelpText<"Options to pass to LLVM">,
1018 def mcpu : Separate<["-"], "mcpu">,
1019 HelpText<"Processor family target for LTO code generation">,
1021 def no_dtrace_dof : Flag<["-"], "no_dtrace_dof">,
1022 HelpText<"Disable dtrace-dof processing (default).">,
1024 def objc_stubs_fast : Flag<["-"], "objc_stubs_fast">,
1025 HelpText<"Produce larger stubs for Objective-C method calls with fewer jumps (default).">,
1027 def objc_stubs_small : Flag<["-"], "objc_stubs_small">,
1028 HelpText<"Produce smaller stubs for Objective-C method calls with more jumps.">,
1030 def dyld_env : Separate<["-"], "dyld_env">,
1031 MetaVarName<"<dyld_env_var>">,
1032 HelpText<"Specifies a LC_DYLD_ENVIRONMENT variable value pair.">,
1034 def ignore_auto_link : Flag<["-"], "ignore_auto_link">,
1035 HelpText<"Ignore LC_LINKER_OPTIONs">,
1038 def grp_deprecated : OptionGroup<"deprecated">, HelpText<"DEPRECATED">;
1040 def lazy_framework : Separate<["-"], "lazy_framework">,
1041 MetaVarName<"<name>">,
1042 HelpText<"This option is deprecated and is now an alias for -framework.">,
1043 Flags<[HelpHidden]>,
1044 Group<grp_deprecated>;
1045 def lazy_library : Separate<["-"], "lazy_library">,
1046 MetaVarName<"<path>">,
1047 HelpText<"This option is deprecated and is now an alias for regular linking">,
1048 Flags<[HelpHidden]>,
1049 Group<grp_deprecated>;
1050 def lazy_l : Joined<["-"], "lazy-l">,
1051 MetaVarName<"<name>">,
1052 HelpText<"This option is deprecated and is now an alias for -l<path>.">,
1053 Flags<[HelpHidden]>,
1054 Group<grp_deprecated>;
1055 def single_module : Flag<["-"], "single_module">,
1056 HelpText<"Unnecessary option: this is already the default">,
1057 Flags<[HelpHidden]>,
1058 Group<grp_deprecated>;
1059 def no_dead_strip_inits_and_terms : Flag<["-"], "no_dead_strip_inits_and_terms">,
1060 HelpText<"Unnecessary option: initialization and termination are roots of the dead strip graph, so never dead stripped">,
1061 Flags<[HelpHidden]>,
1062 Group<grp_deprecated>;
1064 def grp_obsolete : OptionGroup<"obsolete">, HelpText<"OBSOLETE">;
1066 def sectorder : MultiArg<["-"], "sectorder", 3>,
1067 MetaVarName<"<segname> <sectname> <orderfile>">,
1068 HelpText<"Obsolete. Replaced by more general -order_file option">,
1069 Group<grp_obsolete>;
1070 def lto_library : Separate<["-"], "lto_library">,
1071 MetaVarName<"<path>">,
1072 HelpText<"Obsolete. LLD supports LTO directly, without using an external dylib.">,
1073 Group<grp_obsolete>;
1074 def y : Joined<["-"], "y">,
1075 MetaVarName<"<symbol>">,
1076 HelpText<"This option is obsolete in ld64">,
1077 Flags<[HelpHidden]>,
1078 Group<grp_obsolete>;
1079 def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>,
1080 MetaVarName<"<segname> <sectname>">,
1081 HelpText<"This option is obsolete in ld64">,
1082 Flags<[HelpHidden]>,
1083 Group<grp_obsolete>;
1084 def nofixprebinding : Flag<["-"], "nofixprebinding">,
1085 HelpText<"This option is obsolete in ld64">,
1086 Flags<[HelpHidden]>,
1087 Group<grp_obsolete>;
1088 def noprebind_all_twolevel_modules : Flag<["-"], "noprebind_all_twolevel_modules">,
1089 HelpText<"This option is obsolete in ld64">,
1090 Flags<[HelpHidden]>,
1091 Group<grp_obsolete>;
1092 def prebind_all_twolevel_modules : Flag<["-"], "prebind_all_twolevel_modules">,
1093 HelpText<"This option is obsolete in ld64">,
1094 Flags<[HelpHidden]>,
1095 Group<grp_obsolete>;
1096 def prebind_allow_overlap : Flag<["-"], "prebind_allow_overlap">,
1097 HelpText<"This option is obsolete in ld64">,
1098 Flags<[HelpHidden]>,
1099 Group<grp_obsolete>;
1100 def noprebind : Flag<["-"], "noprebind">,
1101 HelpText<"This option is obsolete in ld64">,
1102 Flags<[HelpHidden]>,
1103 Group<grp_obsolete>;
1104 def sect_diff_relocs : Separate<["-"], "sect_diff_relocs">,
1105 MetaVarName<"<treatment>">,
1106 HelpText<"This option is obsolete in ld64">,
1107 Flags<[HelpHidden]>,
1108 Group<grp_obsolete>;
1109 def A : Separate<["-"], "A">,
1110 MetaVarName<"<basefile>">,
1111 HelpText<"This option is obsolete in ld64">,
1112 Flags<[HelpHidden]>,
1113 Group<grp_obsolete>;
1114 def b : Flag<["-"], "b">,
1115 HelpText<"This option is obsolete in ld64">,
1116 Flags<[HelpHidden]>,
1117 Group<grp_obsolete>;
1118 def Sn : Flag<["-"], "Sn">,
1119 HelpText<"This option is obsolete in ld64">,
1120 Flags<[HelpHidden]>,
1121 Group<grp_obsolete>;
1122 def Si : Flag<["-"], "Si">,
1123 HelpText<"This option is obsolete in ld64">,
1124 Flags<[HelpHidden]>,
1125 Group<grp_obsolete>;
1126 def Sp : Flag<["-"], "Sp">,
1127 HelpText<"This option is obsolete in ld64">,
1128 Flags<[HelpHidden]>,
1129 Group<grp_obsolete>;
1130 def X : Flag<["-"], "X">,
1131 HelpText<"This option is obsolete in ld64">,
1132 Flags<[HelpHidden]>,
1133 Group<grp_obsolete>;
1134 def s : Flag<["-"], "s">,
1135 HelpText<"This option is obsolete in ld64">,
1136 Flags<[HelpHidden]>,
1137 Group<grp_obsolete>;
1138 def m : Flag<["-"], "m">,
1139 HelpText<"This option is obsolete in ld64">,
1140 Flags<[HelpHidden]>,
1141 Group<grp_obsolete>;
1142 def Y : Separate<["-"], "Y">,
1143 MetaVarName<"<number>">,
1144 HelpText<"This option is obsolete in ld64">,
1145 Flags<[HelpHidden]>,
1146 Group<grp_obsolete>;
1147 def nomultidefs : Flag<["-"], "nomultidefs">,
1148 HelpText<"This option is obsolete in ld64">,
1149 Flags<[HelpHidden]>,
1150 Group<grp_obsolete>;
1151 def multiply_defined_unused : Separate<["-"], "multiply_defined_unused">,
1152 MetaVarName<"<treatment>">,
1153 HelpText<"This option is obsolete in ld64">,
1154 Flags<[HelpHidden]>,
1155 Group<grp_obsolete>;
1156 def multiply_defined : Separate<["-"], "multiply_defined">,
1157 MetaVarName<"<treatment>">,
1158 HelpText<"This option is obsolete in ld64">,
1159 Flags<[HelpHidden]>,
1160 Group<grp_obsolete>;
1161 def private_bundle : Flag<["-"], "private_bundle">,
1162 HelpText<"This option is obsolete in ld64">,
1163 Flags<[HelpHidden]>,
1164 Group<grp_obsolete>;
1165 def seg_addr_table_filename : Separate<["-"], "seg_addr_table_filename">,
1166 MetaVarName<"<path>">,
1167 HelpText<"This option is obsolete in ld64">,
1168 Flags<[HelpHidden]>,
1169 Group<grp_obsolete>;
1170 def sectorder_detail : Flag<["-"], "sectorder_detail">,
1171 HelpText<"This option is obsolete in ld64">,
1172 Flags<[HelpHidden]>,
1173 Group<grp_obsolete>;
1174 def no_compact_linkedit : Flag<["-"], "no_compact_linkedit">,
1175 HelpText<"This option is obsolete in ld64">,
1176 Flags<[HelpHidden]>,
1177 Group<grp_obsolete>;
1178 def dependent_dr_info : Flag<["-"], "dependent_dr_info">,
1179 HelpText<"This option is obsolete in ld64">,
1180 Flags<[HelpHidden]>,
1181 Group<grp_obsolete>;
1182 def no_dependent_dr_info : Flag<["-"], "no_dependent_dr_info">,
1183 HelpText<"This option is obsolete in ld64">,
1184 Flags<[HelpHidden]>,
1185 Group<grp_obsolete>;
1186 def seglinkedit : Flag<["-"], "seglinkedit">,
1187 HelpText<"This option is obsolete in ld64">,
1188 Flags<[HelpHidden]>,
1189 Group<grp_obsolete>;
1190 def noseglinkedit : Flag<["-"], "noseglinkedit">,
1191 HelpText<"This option is obsolete in ld64">,
1192 Flags<[HelpHidden]>,
1193 Group<grp_obsolete>;
1194 def fvmlib : Flag<["-"], "fvmlib">,
1195 HelpText<"This option is obsolete in ld64">,
1196 Flags<[HelpHidden]>,
1197 Group<grp_obsolete>;
1198 def run_init_lazily : Flag<["-"], "run_init_lazily">,
1199 HelpText<"This option is obsolete in ld64">,
1200 Flags<[HelpHidden]>,
1201 Group<grp_obsolete>;
1202 def prebind : Flag<["-"], "prebind">,
1203 HelpText<"This option is obsolete in ld64">,
1204 Flags<[HelpHidden]>,
1205 Group<grp_obsolete>;
1206 def twolevel_namespace_hints : Flag<["-"], "twolevel_namespace_hints">,
1207 HelpText<"This option is obsolete in ld64">,
1208 Flags<[HelpHidden]>,
1209 Group<grp_obsolete>;
1210 def slow_stubs : Flag<["-"], "slow_stubs">,
1211 HelpText<"This option is obsolete in ld64">,
1212 Flags<[HelpHidden]>,
1213 Group<grp_obsolete>;
1215 def bitcode_bundle : Flag<["-"], "bitcode_bundle">,
1216 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1217 Flags<[HelpHidden]>,
1218 Group<grp_obsolete>;
1219 def bitcode_hide_symbols : Flag<["-"], "bitcode_hide_symbols">,
1220 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1221 Flags<[HelpHidden]>,
1222 Group<grp_obsolete>;
1223 def bitcode_symbol_map : Separate<["-"], "bitcode_symbol_map">,
1224 MetaVarName<"<path>">,
1225 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1226 Flags<[HelpHidden]>,
1227 Group<grp_obsolete>;
1228 def bitcode_process_mode : Separate<["-"], "bitcode_process_mode">,
1229 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1230 Flags<[HelpHidden]>,
1231 Group<grp_obsolete>;
1232 def bitcode_verify : Flag<["-"], "bitcode_verify">,
1233 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1234 Flags<[HelpHidden]>,
1235 Group<grp_obsolete>;
1237 def grp_undocumented : OptionGroup<"undocumented">, HelpText<"UNDOCUMENTED">;
1239 def add_linker_option : Flag<["-"], "add_linker_option">,
1240 HelpText<"This option is undocumented in ld64">,
1241 Flags<[HelpHidden]>,
1242 Group<grp_undocumented>;
1243 def add_source_version : Flag<["-"], "add_source_version">,
1244 HelpText<"This option is undocumented in ld64">,
1245 Flags<[HelpHidden]>,
1246 Group<grp_undocumented>;
1247 def no_source_version : Flag<["-"], "no_source_version">,
1248 HelpText<"This option is undocumented in ld64">,
1249 Flags<[HelpHidden]>,
1250 Group<grp_undocumented>;
1251 def add_split_seg_info : Flag<["-"], "add_split_seg_info">,
1252 HelpText<"This option is undocumented in ld64">,
1253 Flags<[HelpHidden]>,
1254 Group<grp_undocumented>;
1255 def allow_dead_duplicates : Flag<["-"], "allow_dead_duplicates">,
1256 HelpText<"This option is undocumented in ld64">,
1257 Flags<[HelpHidden]>,
1258 Group<grp_undocumented>;
1259 def allow_simulator_linking_to_macosx_dylibs : Flag<["-"], "allow_simulator_linking_to_macosx_dylibs">,
1260 HelpText<"This option is undocumented in ld64">,
1261 Flags<[HelpHidden]>,
1262 Group<grp_undocumented>;
1263 def classic_linker : Flag<["-"], "classic_linker">,
1264 HelpText<"This option is undocumented in ld64">,
1265 Flags<[HelpHidden]>,
1266 Group<grp_undocumented>;
1267 def data_in_code_info : Flag<["-"], "data_in_code_info">,
1268 HelpText<"Emit data-in-code information (default)">,
1269 Group<grp_undocumented>;
1270 def no_data_in_code_info : Flag<["-"], "no_data_in_code_info">,
1271 HelpText<"Do not emit data-in-code information">,
1272 Group<grp_undocumented>;
1273 def debug_snapshot : Flag<["-"], "debug_snapshot">,
1274 HelpText<"This option is undocumented in ld64">,
1275 Flags<[HelpHidden]>,
1276 Group<grp_undocumented>;
1277 def demangle : Flag<["-"], "demangle">,
1278 HelpText<"Demangle symbol names in diagnostics">;
1279 def encryptable : Flag<["-"], "encryptable">,
1280 HelpText<"Generate the LC_ENCRYPTION_INFO load command">,
1281 Group<grp_undocumented>;
1282 def no_encryption : Flag<["-"], "no_encryption">,
1283 HelpText<"Do not generate the LC_ENCRYPTION_INFO load command">,
1284 Group<grp_undocumented>;
1285 def executable_path : Flag<["-"], "executable_path">,
1286 HelpText<"This option is undocumented in ld64">,
1287 Flags<[HelpHidden]>,
1288 Group<grp_undocumented>;
1289 def fixup_chains : Flag<["-"], "fixup_chains">,
1290 HelpText<"Emit chained fixups">,
1291 Group<grp_undocumented>;
1292 def no_fixup_chains : Flag<["-"], "no_fixup_chains">,
1293 HelpText<"Emit fixup information as classic dyld opcodes">,
1294 Group<grp_undocumented>;
1295 def fixup_chains_section : Flag<["-"], "fixup_chains_section">,
1296 HelpText<"This option is undocumented in ld64">,
1297 Flags<[HelpHidden]>,
1298 Group<grp_undocumented>;
1299 def objc_relative_method_lists : Flag<["-"], "objc_relative_method_lists">,
1300 HelpText<"Emit relative method lists (more compact representation)">,
1301 Group<grp_undocumented>;
1302 def no_objc_relative_method_lists : Flag<["-"], "no_objc_relative_method_lists">,
1303 HelpText<"Don't emit relative method lists (use traditional representation)">,
1304 Group<grp_undocumented>;
1305 def flto_codegen_only : Flag<["-"], "flto-codegen-only">,
1306 HelpText<"This option is undocumented in ld64">,
1307 Flags<[HelpHidden]>,
1308 Group<grp_undocumented>;
1309 def force_symbol_not_weak : Flag<["-"], "force_symbol_not_weak">,
1310 HelpText<"This option is undocumented in ld64">,
1311 Flags<[HelpHidden]>,
1312 Group<grp_undocumented>;
1313 def force_symbols_coalesce_list : Flag<["-"], "force_symbols_coalesce_list">,
1314 HelpText<"This option is undocumented in ld64">,
1315 Flags<[HelpHidden]>,
1316 Group<grp_undocumented>;
1317 def force_symbols_not_weak_list : Separate<["-"], "force_symbols_not_weak_list">,
1318 HelpText<"This option is undocumented in ld64">,
1319 Flags<[HelpHidden]>,
1320 Group<grp_undocumented>;
1321 def force_symbols_weak_list : Separate<["-"], "force_symbols_weak_list">,
1322 HelpText<"This option is undocumented in ld64">,
1323 Flags<[HelpHidden]>,
1324 Group<grp_undocumented>;
1325 def force_symbol_weak : Flag<["-"], "force_symbol_weak">,
1326 HelpText<"This option is undocumented in ld64">,
1327 Flags<[HelpHidden]>,
1328 Group<grp_undocumented>;
1329 def function_starts : Flag<["-"], "function_starts">,
1330 HelpText<"Create table of function start addresses (default)">,
1331 Group<grp_undocumented>;
1332 def i : Flag<["-"], "i">,
1333 HelpText<"This option is undocumented in ld64">,
1334 Flags<[HelpHidden]>,
1335 Group<grp_undocumented>;
1336 def ignore_optimization_hints : Flag<["-"], "ignore_optimization_hints">,
1337 HelpText<"Ignore Linker Optimization Hints">,
1338 Group<grp_undocumented>;
1339 def init_offsets : Flag<["-"], "init_offsets">,
1340 HelpText<"Store __TEXT segment offsets of static initializers">,
1341 Group<grp_undocumented>;
1342 def keep_dwarf_unwind : Flag<["-"], "keep_dwarf_unwind">,
1343 HelpText<"This option is undocumented in ld64">,
1344 Flags<[HelpHidden]>,
1345 Group<grp_undocumented>;
1346 def no_keep_dwarf_unwind : Flag<["-"], "no_keep_dwarf_unwind">,
1347 HelpText<"This option is undocumented in ld64">,
1348 Flags<[HelpHidden]>,
1349 Group<grp_undocumented>;
1350 def kext : Flag<["-"], "kext">,
1351 HelpText<"This option is undocumented in ld64">,
1352 Flags<[HelpHidden]>,
1353 Group<grp_undocumented>;
1354 def kext_objects_dir : Flag<["-"], "kext_objects_dir">,
1355 HelpText<"This option is undocumented in ld64">,
1356 Flags<[HelpHidden]>,
1357 Group<grp_undocumented>;
1358 def no_kext_objects : Flag<["-"], "no_kext_objects">,
1359 HelpText<"This option is undocumented in ld64">,
1360 Flags<[HelpHidden]>,
1361 Group<grp_undocumented>;
1362 def kexts_use_stubs : Flag<["-"], "kexts_use_stubs">,
1363 HelpText<"This option is undocumented in ld64">,
1364 Flags<[HelpHidden]>,
1365 Group<grp_undocumented>;
1366 def no_compact_unwind : Flag<["-"], "no_compact_unwind">,
1367 HelpText<"This option is undocumented in ld64">,
1368 Flags<[HelpHidden]>,
1369 Group<grp_undocumented>;
1370 def no_new_main : Flag<["-"], "no_new_main">,
1371 HelpText<"This option is undocumented in ld64">,
1372 Flags<[HelpHidden]>,
1373 Group<grp_undocumented>;
1374 def pause : Flag<["-"], "pause">,
1375 HelpText<"This option is undocumented in ld64">,
1376 Flags<[HelpHidden]>,
1377 Group<grp_undocumented>;
1378 def random_uuid : Flag<["-"], "random_uuid">,
1379 HelpText<"This option is undocumented in ld64">,
1380 Flags<[HelpHidden]>,
1381 Group<grp_undocumented>;
1382 def simulator_support : Flag<["-"], "simulator_support">,
1383 HelpText<"This option is undocumented in ld64">,
1384 Flags<[HelpHidden]>,
1385 Group<grp_undocumented>;
1386 def snapshot_dir : Flag<["-"], "snapshot_dir">,
1387 HelpText<"This option is undocumented in ld64">,
1388 Flags<[HelpHidden]>,
1389 Group<grp_undocumented>;
1390 def source_version : Flag<["-"], "source_version">,
1391 HelpText<"This option is undocumented in ld64">,
1392 Flags<[HelpHidden]>,
1393 Group<grp_undocumented>;
1394 def threaded_starts_section : Flag<["-"], "threaded_starts_section">,
1395 HelpText<"This option is undocumented in ld64">,
1396 Flags<[HelpHidden]>,
1397 Group<grp_undocumented>;
1398 def verbose_optimization_hints : Flag<["-"], "verbose_optimization_hints">,
1399 HelpText<"This option is undocumented in ld64">,
1400 Flags<[HelpHidden]>,
1401 Group<grp_undocumented>;
1402 def version_load_command : Flag<["-"], "version_load_command">,
1403 HelpText<"This option is undocumented in ld64">,
1404 Flags<[HelpHidden]>,
1405 Group<grp_undocumented>;
1407 def grp_ignored : OptionGroup<"ignored">, HelpText<"IGNORED">;
1409 def M : Flag<["-"], "M">,
1410 HelpText<"This option is ignored in ld64">,
1411 Flags<[HelpHidden]>,
1413 def new_linker : Flag<["-"], "new_linker">,
1414 HelpText<"This option is ignored in ld64">,
1415 Flags<[HelpHidden]>,
1418 def grp_ignored_silently : OptionGroup<"ignored_silently">, HelpText<"IGNORED SILENTLY">;
1420 def objc_abi_version : Separate<["-"], "objc_abi_version">,
1421 HelpText<"This option only applies to i386 in ld64">,
1422 Flags<[HelpHidden]>,
1423 Group<grp_ignored_silently>;
1424 def debug_variant : Flag<["-"], "debug_variant">,
1425 HelpText<"Do not warn about issues that are only problems for binaries shipping to customers.">,
1426 Flags<[HelpHidden]>,
1427 Group<grp_ignored_silently>;
1429 // NOTE: This flag should be respected if -warn_duplicate_libraries is ever implemented.
1430 def no_warn_duplicate_libraries : Flag<["-"], "no_warn_duplicate_libraries">,
1431 HelpText<"Do not warn if the input contains duplicate library options.">,
1432 Flags<[HelpHidden]>,
1433 Group<grp_ignored_silently>;