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 irpgo_profile_sort: Separate<["--"], "irpgo-profile-sort">, Group<grp_lld>;
130 def irpgo_profile_sort_eq: Joined<["--"], "irpgo-profile-sort=">,
131 Alias<!cast<Separate>(irpgo_profile_sort)>, MetaVarName<"<profile>">,
132 HelpText<"Read the IRPGO profile at <profile> to order sections to improve startup time">,
134 def compression_sort_startup_functions: Flag<["--"], "compression-sort-startup-functions">,
135 HelpText<"Order startup functions to improve compressed size in addition to startup time">,
137 def no_compression_sort_startup_functions: Flag<["--"], "no-compression-sort-startup-functions">,
138 HelpText<"Do not order startup function for compression">, Group<grp_lld>;
139 def compression_sort: Joined<["--"], "compression-sort=">,
140 MetaVarName<"[none,function,data,both]">,
141 HelpText<"Order sections to improve compressed size">, Group<grp_lld>;
142 def verbose_bp_section_orderer: Flag<["--"], "verbose-bp-section-orderer">,
143 HelpText<"Print information on how many sections were ordered by balanced partitioning and a measure of the expected number of page faults">,
145 def ignore_auto_link_option : Separate<["--"], "ignore-auto-link-option">,
147 def ignore_auto_link_option_eq : Joined<["--"], "ignore-auto-link-option=">,
148 Alias<!cast<Separate>(ignore_auto_link_option)>,
149 HelpText<"Ignore a single auto-linked library or framework. Useful to ignore invalid options that ld64 ignores">,
151 def strict_auto_link : Flag<["--"], "strict-auto-link">,
152 HelpText<"Always warn for missing frameworks or libraries if they are loaded via LC_LINKER_OPTIONS">,
154 def check_category_conflicts : Flag<["--"], "check-category-conflicts">,
155 HelpText<"Check for conflicts between category & class methods">,
157 def objc_category_merging : Flag<["-"], "objc_category_merging">,
158 HelpText<"Merge Objective-C categories that share the same base class">,
160 def no_objc_category_merging : Flag<["-"], "no_objc_category_merging">,
161 HelpText<"Do not merge Objective-C categories">,
163 def lto_debug_pass_manager: Flag<["--"], "lto-debug-pass-manager">,
164 HelpText<"Debug new pass manager">, Group<grp_lld>;
165 def codegen_data_generate_path : Separate<["--"], "codegen-data-generate-path">, Group<grp_lld>;
166 def codegen_data_generate_path_eq : Joined<["--"], "codegen-data-generate-path=">,
167 Alias<!cast<Separate>(codegen_data_generate_path)>, MetaVarName<"<cgdata>">,
168 HelpText<"Write the CG data to the specified path <cgdata>.">, Group<grp_lld>;
169 def cs_profile_generate: Flag<["--"], "cs-profile-generate">,
170 HelpText<"Perform context sensitive PGO instrumentation">, Group<grp_lld>;
171 def cs_profile_path: Joined<["--"], "cs-profile-path=">,
172 HelpText<"Context sensitive profile file path">, Group<grp_lld>;
173 defm pgo_warn_mismatch: BB<"pgo-warn-mismatch",
174 "turn on warnings about profile cfg mismatch (default)",
175 "turn off warnings about profile cfg mismatch">, Group<grp_lld>;
176 defm warn_thin_archive_missing_members : BB<"warn-thin-archive-missing-members",
177 "Warn on missing object files referenced by thin archives (default)",
178 "Do not warn on missing object files referenced by thin archives">, Group<grp_lld>;
180 // This is a complete Options.td compiled from Apple's ld(1) manpage
181 // dated 2018-03-07 and cross checked with ld64 source code in repo
182 // https://github.com/apple-opensource/ld64 at git tag "512.4" dated
185 // Flags<[HelpHidden]> marks options that are not yet ported to lld,
186 // and serve as a scoreboard for annotating our progress toward
187 // implementing ld64 options in lld. As you add implementions to
188 // Driver.cpp, please remove the hidden flag here.
190 def grp_kind : OptionGroup<"kind">, HelpText<"OUTPUT KIND">;
192 def execute : Flag<["-"], "execute">,
193 HelpText<"Produce a main executable (default)">,
195 def dylib : Flag<["-"], "dylib">,
196 HelpText<"Produce a shared library">,
198 def bundle : Flag<["-"], "bundle">,
199 HelpText<"Produce a bundle">,
201 def r : Flag<["-"], "r">,
202 HelpText<"Merge multiple object files into one, retaining relocations">,
205 def dylinker : Flag<["-"], "dylinker">,
206 HelpText<"Produce a dylinker only used when building dyld">,
209 def dynamic : Flag<["-"], "dynamic">,
210 HelpText<"Link dynamically (default)">,
212 def static : Flag<["-"], "static">,
213 HelpText<"Link statically">,
216 def preload : Flag<["-"], "preload">,
217 HelpText<"Produce an unsegmented binary for embedded systems">,
220 def arch : Separate<["-"], "arch">,
221 MetaVarName<"<arch_name>">,
222 HelpText<"The architecture (e.g. ppc, ppc64, i386, x86_64)">,
224 def o : Separate<["-"], "o">,
225 MetaVarName<"<path>">,
226 HelpText<"The name of the output file (default: `a.out')">,
229 def grp_libs : OptionGroup<"libs">, HelpText<"LIBRARIES">;
231 def l : Joined<["-"], "l">,
232 MetaVarName<"<name>">,
233 HelpText<"Search for lib<name>.dylib or lib<name>.a on the library search path">,
235 def weak_l : Joined<["-"], "weak-l">,
236 MetaVarName<"<name>">,
237 HelpText<"Like -l<name>, but mark library and its references as weak imports">,
239 def weak_library : Separate<["-"], "weak_library">,
240 MetaVarName<"<path>">,
241 HelpText<"Like bare <path>, but mark library and its references as weak imports">,
243 def needed_l : Joined<["-"], "needed-l">,
244 MetaVarName<"<name>">,
245 HelpText<"Like -l<name>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
247 def needed_library : Separate<["-"], "needed_library">,
248 MetaVarName<"<path>">,
249 HelpText<"Like bare <path>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
251 def reexport_l : Joined<["-"], "reexport-l">,
252 MetaVarName<"<name>">,
253 HelpText<"Like -l<name>, but export all symbols of <name> from newly created library">,
255 def reexport_library : Separate<["-"], "reexport_library">,
256 MetaVarName<"<path>">,
257 HelpText<"Like bare <path>, but export all symbols of <path> from newly created library">,
259 def upward_l : Joined<["-"], "upward-l">,
260 MetaVarName<"<name>">,
261 HelpText<"Like -l<name>, but specify dylib as an upward dependency">,
264 def upward_library : Separate<["-"], "upward_library">,
265 MetaVarName<"<path>">,
266 HelpText<"Like bare <path>, but specify dylib as an upward dependency">,
269 def L : JoinedOrSeparate<["-"], "L">,
270 MetaVarName<"<dir>">,
271 HelpText<"Add dir to the library search path">,
273 def Z : Flag<["-"], "Z">,
274 HelpText<"Remove standard directories from the library and framework search paths">,
276 def syslibroot : Separate<["-"], "syslibroot">,
277 MetaVarName<"<rootdir>">,
278 HelpText<"Prepend <rootdir> to all library and framework search paths">,
280 def search_paths_first : Flag<["-"], "search_paths_first">,
281 HelpText<"Search for lib<name>.dylib and lib<name>.a at each step in traversing search path (default for Xcode 4 and later)">,
283 def search_dylibs_first : Flag<["-"], "search_dylibs_first">,
284 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)">,
286 def framework : Separate<["-"], "framework">,
287 MetaVarName<"<name>">,
288 HelpText<"Search for <name>.framework/<name> on the framework search path">,
290 def weak_framework : Separate<["-"], "weak_framework">,
291 MetaVarName<"<name>">,
292 HelpText<"Like -framework <name>, but mark framework and its references as weak imports">,
294 def needed_framework : Separate<["-"], "needed_framework">,
295 MetaVarName<"<name>">,
296 HelpText<"Like -framework <name>, but link <name> even if none of its symbols are used and -dead_strip_dylibs is active">,
298 def reexport_framework : Separate<["-"], "reexport_framework">,
299 MetaVarName<"<name>">,
300 HelpText<"Like -framework <name>, but export all symbols of <name> from the newly created library">,
302 def upward_framework : Separate<["-"], "upward_framework">,
303 MetaVarName<"<name>">,
304 HelpText<"Like -framework <name>, but specify the framework as an upward dependency">,
307 def F : JoinedOrSeparate<["-"], "F">,
308 MetaVarName<"<dir>">,
309 HelpText<"Add dir to the framework search path">,
311 def all_load : Flag<["-"], "all_load">,
312 HelpText<"Load all members of all static archive libraries">,
314 def noall_load : Flag<["-"], "noall_load">,
315 HelpText<"Don't load all static members from archives, this is the default, this negates -all_load">,
317 def ObjC : Flag<["-"], "ObjC">,
318 HelpText<"Load all members of static archives that are an Objective-C class or category.">,
320 def force_load : Separate<["-"], "force_load">,
321 MetaVarName<"<path>">,
322 HelpText<"Load all members static archive library at <path>">,
324 def force_load_swift_libs : Flag<["-"], "force_load_swift_libs">,
325 HelpText<"Apply -force_load to libraries listed in LC_LINKER_OPTIONS whose names start with 'swift'">,
327 def load_hidden : Separate<["-"], "load_hidden">,
328 MetaVarName<"<path>">,
329 HelpText<"Load all symbols from static library with hidden visibility">,
331 def hidden_l : Joined<["-"], "hidden-l">,
332 MetaVarName<"<name>">,
333 HelpText<"Like -l<name>, but load all symbols with hidden visibility">,
336 def grp_content : OptionGroup<"content">, HelpText<"ADDITIONAL CONTENT">;
338 def sectcreate : MultiArg<["-"], "sectcreate", 3>,
339 MetaVarName<"<segment> <section> <file>">,
340 HelpText<"Create <section> in <segment> from the contents of <file>">,
342 def segcreate : MultiArg<["-"], "segcreate", 3>,
343 MetaVarName<"<segment> <section> <file>">,
345 HelpText<"Alias for -sectcreate">,
347 def add_empty_section : MultiArg<["-"], "add_empty_section", 2>,
348 MetaVarName<"<segment> <section>">,
349 HelpText<"Create an empty <section> in <segment>">,
351 def filelist : Separate<["-"], "filelist">,
352 MetaVarName<"<file>">,
353 HelpText<"Read names of files to link from <file>">,
355 def dtrace : Separate<["-"], "dtrace">,
356 MetaVarName<"<script>">,
357 HelpText<"Enable DTrace static probes according to declarations in <script>">,
361 def grp_opts : OptionGroup<"opts">, HelpText<"OPTIMIZATIONS">;
363 def dead_strip : Flag<["-"], "dead_strip">,
364 HelpText<"Remove unreachable functions and data">,
366 def order_file : Separate<["-"], "order_file">,
367 MetaVarName<"<file>">,
368 HelpText<"Layout functions and data according to specification in <file>">,
370 def no_order_inits : Flag<["-"], "no_order_inits">,
371 HelpText<"Disable default reordering of initializer and terminator functions">,
374 def no_order_data : Flag<["-"], "no_order_data">,
375 HelpText<"Disable default reordering of global data accessed at launch time">,
378 def image_base : Separate<["-"], "image_base">,
379 MetaVarName<"<address>">,
380 HelpText<"Preferred hex load address for a dylib or bundle.">,
383 def seg1addr : Separate<["-"], "seg1addr">,
384 MetaVarName<"<address>">,
386 HelpText<"Alias for -image_base">,
389 def no_implicit_dylibs : Flag<["-"], "no_implicit_dylibs">,
390 HelpText<"Do not optimize public dylib transitive symbol references">,
392 def exported_symbols_order : Separate<["-"], "exported_symbols_order">,
393 MetaVarName<"<file>">,
394 HelpText<"Specify frequently-used symbols in <file> to optimize symbol exports">,
397 def no_zero_fill_sections : Flag<["-"], "no_zero_fill_sections">,
398 HelpText<"Explicitly store zeroed data in the final image">,
401 def merge_zero_fill_sections : Flag<["-"], "merge_zero_fill_sections">,
402 HelpText<"Merge all zeroed data into the __zerofill section">,
405 def no_branch_islands : Flag<["-"], "no_branch_islands">,
406 HelpText<"Disable infra for branches beyond the maximum branch distance.">,
409 def no_deduplicate : Flag<["-"], "no_deduplicate">,
410 HelpText<"Disable code deduplication (synonym for `--icf=none')">,
411 Alias<icf_eq>, AliasArgs<["none"]>,
414 def grp_version : OptionGroup<"version">, HelpText<"VERSION TARGETING">;
416 def platform_version : MultiArg<["-"], "platform_version", 3>,
417 MetaVarName<"<platform> <min_version> <sdk_version>">,
418 HelpText<"Platform (e.g., macos, ios, tvos, watchos, xros, bridgeos, mac-catalyst, ios-sim, tvos-sim, watchos-sim, xros-sim, driverkit) and version numbers">,
420 def sdk_version : Separate<["-"], "sdk_version">,
421 HelpText<"This option is undocumented in ld64">,
424 def macos_version_min : Separate<["-"], "macos_version_min">,
425 MetaVarName<"<version>">,
426 HelpText<"Oldest macOS version for which linked output is usable">,
428 def macosx_version_min : Separate<["-"], "macosx_version_min">,
429 MetaVarName<"<version>">,
430 Alias<macos_version_min>,
431 HelpText<"Alias for -macos_version_min">,
434 def ios_version_min : Separate<["-"], "ios_version_min">,
435 MetaVarName<"<version>">,
436 HelpText<"Oldest iOS version for which linked output is usable">,
439 def ios_simulator_version_min : Separate<["-"], "ios_simulator_version_min">,
440 MetaVarName<"<version>">,
441 HelpText<"Oldest iOS simulator version for which linked output is usable">,
444 def iphoneos_version_min : Separate<["-"], "iphoneos_version_min">,
445 MetaVarName<"<version>">,
446 Alias<ios_version_min>,
447 HelpText<"Alias for -ios_version_min">,
450 def maccatalyst_version_min : Separate<["-"], "maccatalyst_version_min">,
451 MetaVarName<"<version>">,
452 HelpText<"Oldest MacCatalyst version for which linked output is usable">,
455 def iosmac_version_min : Separate<["-"], "iosmac_version_min">,
456 MetaVarName<"<version>">,
457 Alias<maccatalyst_version_min>,
458 HelpText<"Alias for -maccatalyst_version_min">,
461 def uikitformac_version_min : Separate<["-"], "uikitformac_version_min">,
462 MetaVarName<"<version>">,
463 Alias<maccatalyst_version_min>,
464 HelpText<"Alias for -maccatalyst_version_min">,
467 def tvos_version_min : Separate<["-"], "tvos_version_min">,
468 MetaVarName<"<version>">,
469 HelpText<"Oldest tvOS version for which linked output is usable">,
472 def watchos_version_min : Separate<["-"], "watchos_version_min">,
473 MetaVarName<"<version>">,
474 HelpText<"Oldest watchOS version for which linked output is usable">,
477 def bridgeos_version_min : Separate<["-"], "bridgeos_version_min">,
478 MetaVarName<"<version>">,
479 HelpText<"Oldest bridgeOS version for which linked output is usable">,
482 def driverkit_version_min : Separate<["-"], "driverkit_version_min">,
483 MetaVarName<"<version>">,
484 HelpText<"Oldest DriverKit version for which linked output is usable">,
488 def grp_dylib : OptionGroup<"dylib">, HelpText<"DYNAMIC LIBRARIES (DYLIB)">;
490 def install_name : Separate<["-"], "install_name">,
491 MetaVarName<"<name>">,
492 HelpText<"Set an internal install path in a dylib">,
494 def dylib_install_name : Separate<["-"], "dylib_install_name">,
495 MetaVarName<"<name>">,
497 HelpText<"Alias for -install_name">,
499 def dylinker_install_name : Separate<["-"], "dylinker_install_name">,
500 MetaVarName<"<name>">,
502 HelpText<"Alias for -install_name">,
504 def mark_dead_strippable_dylib : Flag<["-"], "mark_dead_strippable_dylib">,
505 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">,
507 def compatibility_version : Separate<["-"], "compatibility_version">,
508 MetaVarName<"<version>">,
509 HelpText<"Compatibility <version> of this library">,
511 def dylib_compatibility_version : Separate<["-"], "dylib_compatibility_version">,
512 MetaVarName<"<version>">,
513 Alias<compatibility_version>,
514 HelpText<"Alias for -compatibility_version">,
517 def current_version : Separate<["-"], "current_version">,
518 MetaVarName<"<version>">,
519 HelpText<"Current <version> of this library">,
521 def dylib_current_version : Separate<["-"], "dylib_current_version">,
522 MetaVarName<"<version>">,
523 Alias<current_version>,
524 HelpText<"Alias for -current_version">,
528 def grp_main : OptionGroup<"main">, HelpText<"MAIN EXECUTABLE">;
530 def pie : Flag<["-"], "pie">,
531 HelpText<"Build a position independent executable (default)">,
533 def no_pie : Flag<["-"], "no_pie">,
534 HelpText<"Do not build a position independent executable">,
536 def pagezero_size : Separate<["-"], "pagezero_size">,
537 MetaVarName<"<size>">,
538 HelpText<"Size of unreadable segment at address zero is hex <size> (default is 4KB on 32-bit and 4GB on 64-bit)">,
540 def stack_size : Separate<["-"], "stack_size">,
541 MetaVarName<"<size>">,
542 HelpText<"Maximum hex stack size for the main thread in a program. (default is 8MB)">,
545 def allow_stack_execute : Flag<["-"], "allow_stack_execute">,
546 HelpText<"Mark stack segment as executable">,
549 def export_dynamic : Flag<["-"], "export_dynamic">,
550 HelpText<"Preserve all global symbols during LTO and when dead-stripping executables">,
553 def grp_bundle : OptionGroup<"bundle">, HelpText<"CREATING A BUNDLE">;
555 def bundle_loader : Separate<["-"], "bundle_loader">,
556 MetaVarName<"<executable>">,
557 HelpText<"Resolve undefined symbols from <executable>">,
560 def grp_object : OptionGroup<"object">, HelpText<"CREATING AN OBJECT FILE">;
562 def keep_private_externs : Flag<["-"], "keep_private_externs">,
563 HelpText<"Do not convert private external symbols to static symbols (only valid with -r)">,
566 def d : Flag<["-"], "d">,
567 HelpText<"Force tentative into real definitions for common symbols">,
571 def grp_resolve : OptionGroup<"resolve">, HelpText<"SYMBOL RESOLUTION">;
573 def exported_symbol : Separate<["-"], "exported_symbol">,
574 MetaVarName<"<symbol>">,
575 HelpText<"<symbol> remains global, while others become private externs">,
577 def exported_symbols_list : Separate<["-"], "exported_symbols_list">,
578 MetaVarName<"<file>">,
579 HelpText<"Symbols specified in <file> remain global, while others become private externs">,
581 def no_exported_symbols : Flag<["-"], "no_exported_symbols">,
582 HelpText<"Don't export any symbols from the binary, useful for main executables that don't have plugins">,
584 def unexported_symbol : Separate<["-"], "unexported_symbol">,
585 MetaVarName<"<symbol>">,
586 HelpText<"Global <symbol> becomes private extern">,
588 def unexported_symbols_list : Separate<["-"], "unexported_symbols_list">,
589 MetaVarName<"<file>">,
590 HelpText<"Global symbols specified in <file> become private externs">,
592 def reexported_symbols_list : Separate<["-"], "reexported_symbols_list">,
593 MetaVarName<"<file>">,
594 HelpText<"Symbols from dependent dylibs specified in <file> are reexported by this dylib">,
597 def alias : MultiArg<["-"], "alias", 2>,
598 MetaVarName<"<symbol_name> <alternate_name>">,
599 HelpText<"Create a symbol alias with default global visibility">,
601 def alias_list : Separate<["-"], "alias_list">,
602 MetaVarName<"<file>">,
603 HelpText<"Create symbol aliases specified in <file>">,
606 def flat_namespace : Flag<["-"], "flat_namespace">,
607 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">,
609 def twolevel_namespace : Flag<["-"], "twolevel_namespace">,
610 HelpText<"Make dyld look up symbols by (dylib,name) pairs (default)">,
612 def u : Separate<["-"], "u">,
613 MetaVarName<"<symbol>">,
614 HelpText<"Require that <symbol> be defined for the link to succeed">,
616 def U : Separate<["-"], "U">,
617 MetaVarName<"<symbol>">,
618 HelpText<"Allow <symbol> to have no definition">,
620 def undefined : Separate<["-"], "undefined">,
621 MetaVarName<"<treatment>">,
622 HelpText<"Handle undefined symbols according to <treatment>: error, warning, suppress, or dynamic_lookup (default is error)">,
624 def rpath : Separate<["-"], "rpath">,
625 MetaVarName<"<path>">,
626 HelpText<"Add <path> to dyld search list for dylibs with load path prefix `@rpath/'">,
628 def commons : Separate<["-"], "commons">,
629 MetaVarName<"<treatment>">,
630 HelpText<"Resolve tentative definitions in dylibs according to <treatment>: ignore_dylibs, use_dylibs, error (default is ignore_dylibs)">,
634 def grp_introspect : OptionGroup<"introspect">, HelpText<"INTROSPECTING THE LINKER">;
636 def why_load : Flag<["-"], "why_load">,
637 HelpText<"Log why each object file is loaded from a static library">,
638 Group<grp_introspect>;
639 def whyload : Flag<["-"], "whyload">,
641 HelpText<"Alias for -why_load">,
642 Group<grp_introspect>;
643 def why_live : Separate<["-"], "why_live">,
644 MetaVarName<"<symbol>">,
645 HelpText<"Log a chain of references to <symbol>, for use with -dead_strip">,
646 Group<grp_introspect>;
647 def print_statistics : Flag<["-"], "print_statistics">,
648 HelpText<"Log the linker's memory and CPU usage">,
650 Group<grp_introspect>;
651 def t : Flag<["-"], "t">,
652 HelpText<"Log every file the linker loads: object, archive, and dylib">,
653 Group<grp_introspect>;
654 def whatsloaded : Flag<["-"], "whatsloaded">,
655 HelpText<"Logs only the object files the linker loads">,
657 Group<grp_introspect>;
658 def order_file_statistics : Flag<["-"], "order_file_statistics">,
659 HelpText<"Logs information about -order_file">,
661 Group<grp_introspect>;
662 def map : Separate<["-"], "map">,
663 MetaVarName<"<path>">,
664 HelpText<"Writes all symbols and their addresses to <path>">,
665 Group<grp_introspect>;
666 def dependency_info : Separate<["-"], "dependency_info">,
667 MetaVarName<"<path>">,
668 HelpText<"Dump dependency info">,
669 Group<grp_introspect>;
670 def save_temps : Flag<["-"], "save-temps">,
671 HelpText<"Save intermediate LTO compilation results">,
672 Group<grp_introspect>;
674 def grp_symtab : OptionGroup<"symtab">, HelpText<"SYMBOL TABLE">;
676 def S : Flag<["-"], "S">,
677 HelpText<"Strip debug information (STABS or DWARF) from the output">,
679 def x : Flag<["-"], "x">,
680 HelpText<"Exclude non-global symbols from the output symbol table">,
682 def non_global_symbols_strip_list : Separate<["-"], "non_global_symbols_strip_list">,
683 MetaVarName<"<path>">,
684 HelpText<"Specify in <path> the non-global symbols that should be removed from the output symbol table">,
686 def non_global_symbols_no_strip_list : Separate<["-"], "non_global_symbols_no_strip_list">,
687 MetaVarName<"<path>">,
688 HelpText<"Specify in <path> the non-global symbols that should remain in the output symbol table">,
690 def oso_prefix : Separate<["-"], "oso_prefix">,
691 MetaVarName<"<path>">,
692 HelpText<"Remove the prefix <path> from OSO symbols in the debug map">,
694 def add_ast_path : Separate<["-"], "add_ast_path">,
695 MetaVarName<"<path>">,
696 HelpText<"AST paths will be emitted as STABS">,
699 def grp_rare : OptionGroup<"rare">, HelpText<"RARELY USED">;
701 def v : Flag<["-"], "v">,
702 HelpText<"Print the linker version and search paths in addition to linking">,
704 def adhoc_codesign : Flag<["-"], "adhoc_codesign">,
705 HelpText<"Write an ad-hoc code signature to the output file (default for arm64 binaries)">,
707 def no_adhoc_codesign : Flag<["-"], "no_adhoc_codesign">,
708 HelpText<"Do not write an ad-hoc code signature to the output file (default for x86_64 binaries)">,
710 def reproducible : Flag<["-"], "reproducible">,
711 HelpText<"Make the output reproducible by removing timestamps and other non-deterministic data. This is the default behavior.">,
713 def version_details : Flag<["-"], "version_details">,
714 HelpText<"Print the linker version in JSON form">,
717 def no_weak_imports : Flag<["-"], "no_weak_imports">,
718 HelpText<"Fail if any symbols are weak imports, allowed to be NULL at runtime">,
721 def verbose_deduplicate : Flag<["-"], "verbose_deduplicate">,
722 HelpText<"Print function names eliminated by deduplication and the total size of code savings">,
725 def no_inits : Flag<["-"], "no_inits">,
726 HelpText<"Fail if the output contains static initializers">,
729 def no_warn_inits : Flag<["-"], "no_warn_inits">,
730 HelpText<"Suppress warnings for static initializers in the output">,
733 def unaligned_pointers : Separate<["-"], "unaligned_pointers">,
734 MetaVarName<"<treatment>">,
735 HelpText<"Handle unaligned pointers in __DATA segments according to <treatment>: warning, error, or suppress (default for arm64e is error, otherwise suppress)">,
738 def dirty_data_list : Separate<["-"], "dirty_data_list">,
739 MetaVarName<"<path>">,
740 HelpText<"Specify data symbols in <path> destined for the __DATA_DIRTY segment">,
743 def max_default_common_align : Separate<["-"], "max_default_common_align">,
744 MetaVarName<"<boundary>">,
745 HelpText<"Reduce maximum alignment for common symbols to a hex power-of-2 <boundary>">,
748 def move_to_rw_segment : MultiArg<["-"], "move_to_rw_segment", 2>,
749 MetaVarName<"<segment> <path>">,
750 HelpText<"Move data symbols listed in <path> to another <segment>">,
753 def move_to_ro_segment : MultiArg<["-"], "move_to_ro_segment", 2>,
754 MetaVarName<"<segment> <path>">,
755 HelpText<"Move code symbols listed in <path> to another <segment>">,
758 def rename_section : MultiArg<["-"], "rename_section", 4>,
759 MetaVarName<"<from_segment> <from_section> <to_segment> <to_section>">,
760 HelpText<"Rename <from_segment>/<from_section> as <to_segment>/<to_section>">,
762 def rename_segment : MultiArg<["-"], "rename_segment", 2>,
763 MetaVarName<"<from_segment> <to_segment>">,
764 HelpText<"Rename <from_segment> as <to_segment>">,
766 def trace_symbol_layout : Flag<["-"], "trace_symbol_layout">,
767 HelpText<"Show where and why symbols move, as specified by -move_to_ro_segment, -move_to_rw_segment, -rename_section, and -rename_segment">,
770 def data_const : Flag<["-"], "data_const">,
771 HelpText<"Force migration of readonly data into __DATA_CONST segment">,
773 def no_data_const : Flag<["-"], "no_data_const">,
774 HelpText<"Block migration of readonly data away from __DATA segment">,
776 def text_exec : Flag<["-"], "text_exec">,
777 HelpText<"Rename __segment TEXT to __TEXT_EXEC for sections __text and __stubs">,
780 def section_order : MultiArg<["-"], "section_order", 2>,
781 MetaVarName<"<segment> <sections>">,
782 HelpText<"With -preload, specify layout sequence of colon-separated <sections> in <segment>">,
785 def segment_order : Separate<["-"], "segment_order">,
786 MetaVarName<"<colon_separated_segment_list>">,
787 HelpText<"With -preload, specify layout sequence of colon-separated <segments>">,
790 def allow_heap_execute : Flag<["-"], "allow_heap_execute">,
791 HelpText<"On i386, allow any page to execute code">,
794 def application_extension : Flag<["-"], "application_extension">,
795 HelpText<"Mark output as safe for use in an application extension, and validate that linked dylibs are safe">,
797 def no_application_extension : Flag<["-"], "no_application_extension">,
798 HelpText<"Disable application extension functionality (default)">,
800 def fatal_warnings : Flag<["-"], "fatal_warnings">,
801 HelpText<"Treat warnings as errors">,
803 def no_eh_labels : Flag<["-"], "no_eh_labels">,
804 HelpText<"In -r mode, suppress .eh labels in the __eh_frame section">,
807 def warn_compact_unwind : Flag<["-"], "warn_compact_unwind">,
808 HelpText<"Warn for each FDE that cannot compact into the __unwind_info section and must remain in the __eh_frame section">,
811 def warn_weak_exports : Flag<["-"], "warn_weak_exports">,
812 HelpText<"Warn if the linked image contains weak external symbols">,
815 def no_weak_exports : Flag<["-"], "no_weak_exports">,
816 HelpText<"Fail if the linked image contains weak external symbols">,
819 def objc_gc_compaction : Flag<["-"], "objc_gc_compaction">,
820 HelpText<"Mark the Objective-C image as compatible with compacting garbage collection">,
823 def objc_gc : Flag<["-"], "objc_gc">,
824 HelpText<"Verify that all code was compiled with -fobjc-gc or -fobjc-gc-only">,
827 def objc_gc_only : Flag<["-"], "objc_gc_only">,
828 HelpText<"Verify that all code was compiled with -fobjc-gc-only">,
831 def dead_strip_dylibs : Flag<["-"], "dead_strip_dylibs">,
832 HelpText<"Remove dylibs that are unreachable by the entry point or exported symbols">,
834 def allow_sub_type_mismatches : Flag<["-"], "allow_sub_type_mismatches">,
835 HelpText<"Permit mixing objects compiled for different ARM CPU subtypes">,
838 def no_uuid : Flag<["-"], "no_uuid">,
839 HelpText<"Do not generate the LC_UUID load command">,
841 def root_safe : Flag<["-"], "root_safe">,
842 HelpText<"Set the MH_ROOT_SAFE bit in the mach-o header">,
845 def setuid_safe : Flag<["-"], "setuid_safe">,
846 HelpText<"Set the MH_SETUID_SAFE bit in the mach-o header">,
849 def interposable : Flag<["-"], "interposable">,
850 HelpText<"Indirects access to all to exported symbols in a dylib">,
853 def multi_module : Flag<["-"], "multi_module">,
855 HelpText<"Alias for -interposable">,
858 def init : Separate<["-"], "init">,
859 MetaVarName<"<symbol>">,
860 HelpText<"Run <symbol> as the first initializer in a dylib">,
863 def sub_library : Separate<["-"], "sub_library">,
864 MetaVarName<"<name>">,
865 HelpText<"Re-export the dylib as <name>">,
867 def sub_umbrella : Separate<["-"], "sub_umbrella">,
868 MetaVarName<"<name>">,
869 HelpText<"Re-export the framework as <name>">,
871 def allowable_client : Separate<["-"], "allowable_client">,
872 MetaVarName<"<name>">,
873 HelpText<"Specify <name> of a dylib or framework that is allowed to link to this dylib">,
876 def client_name : Separate<["-"], "client_name">,
877 MetaVarName<"<name>">,
878 HelpText<"Specifies a <name> this client should match with the -allowable_client <name> in an explicitly linked dylib">,
880 def umbrella : Separate<["-"], "umbrella">,
881 MetaVarName<"<name>">,
882 HelpText<"Re-export this dylib through the umbrella framework <name>">,
884 def headerpad : Separate<["-"], "headerpad">,
885 MetaVarName<"<size>">,
886 HelpText<"Allocate hex <size> extra space for future expansion of the load commands via install_name_tool (default is 0x20)">,
888 def headerpad_max_install_names : Flag<["-"], "headerpad_max_install_names">,
889 HelpText<"Allocate extra space so all load-command paths can expand to MAXPATHLEN via install_name_tool">,
891 def bind_at_load : Flag<["-"], "bind_at_load">,
892 HelpText<"Tell dyld to bind all symbols at load time, rather than lazily">,
895 def force_flat_namespace : Flag<["-"], "force_flat_namespace">,
896 HelpText<"Tell dyld to use a flat namespace on this executable and all its dependent dylibs & bundles">,
899 def segalign : Separate<["-"], "segalign">,
900 MetaVarName<"<boundary>">,
901 HelpText<"Align all segments to hex power-of-2 <boundary>">,
904 def sectalign : MultiArg<["-"], "sectalign", 3>,
905 MetaVarName<"<segment> <section> <boundary>">,
906 HelpText<"Align <section> within <segment> to hex power-of-2 <boundary>">,
908 def stack_addr : Separate<["-"], "stack_addr">,
909 MetaVarName<"<address>">,
910 HelpText<"Initialize stack pointer to hex <address> rounded to a page boundary">,
913 def segprot : MultiArg<["-"], "segprot", 3>,
914 MetaVarName<"<segment> <max> <init>">,
915 HelpText<"Specifies the <max> and <init> virtual memory protection of <segment> as r/w/x/-seg_addr_table path">,
917 def segs_read_write_addr : Separate<["-"], "segs_read_write_addr">,
918 MetaVarName<"<address>">,
919 HelpText<"This option is obsolete">,
922 def segs_read_only_addr : Separate<["-"], "segs_read_only_addr">,
923 MetaVarName<"<address>">,
924 HelpText<"This option is obsolete">,
927 def segaddr : MultiArg<["-"], "segaddr", 2>,
928 MetaVarName<"<segment> <address>">,
929 HelpText<"Specify the starting hex <address> at a 4KiB page boundary for <segment>">,
932 def seg_page_size : MultiArg<["-"], "seg_page_size", 2>,
933 MetaVarName<"<segment> <size>">,
934 HelpText<"Specifies the page <size> for <segment>. Segment size will be a multiple of its page size">,
937 def dylib_file : Separate<["-"], "dylib_file">,
938 MetaVarName<"<install_path:current_path>">,
939 HelpText<"Specify <current_path> as different from where a dylib normally resides at <install_path>">,
942 def weak_reference_mismatches : Separate<["-"], "weak_reference_mismatches">,
943 MetaVarName<"<treatment>">,
944 HelpText<"Resolve symbol imports of conflicting weakness according to <treatment> as weak, non-weak, or error (default is non-weak)">,
947 def read_only_relocs : Separate<["-"], "read_only_relocs">,
948 MetaVarName<"<treatment>">,
949 HelpText<"Handle relocations that modify read-only pages according to <treatment> of warning, error, or suppress (i.e., allow)">,
952 def force_cpusubtype_ALL : Flag<["-"], "force_cpusubtype_ALL">,
953 HelpText<"Mark binary as runnable on any PowerPC, ignoring any PowerPC cpu requirements encoded in the object files">,
956 def no_arch_warnings : Flag<["-"], "no_arch_warnings">,
957 HelpText<"Suppresses warnings about inputs whose architecture does not match the -arch option">,
960 def arch_errors_fatal : Flag<["-"], "arch_errors_fatal">,
961 HelpText<"Escalate to errors any warnings about inputs whose architecture does not match the -arch option">,
963 def e : Separate<["-"], "e">,
964 MetaVarName<"<symbol>">,
965 HelpText<"Make <symbol> the entry point of an executable (default is \"start\" from crt1.o)">,
967 def w : Flag<["-"], "w">,
968 HelpText<"Suppress all warnings">,
970 def final_output : Separate<["-"], "final_output">,
971 MetaVarName<"<name>">,
972 HelpText<"Specify dylib install name if -install_name is not used; used by compiler driver for multiple -arch arguments">,
974 def arch_multiple : Flag<["-"], "arch_multiple">,
975 HelpText<"Augment error and warning messages with the architecture name">,
977 def dot : Separate<["-"], "dot">,
978 MetaVarName<"<path>">,
979 HelpText<"Write a graph of symbol dependencies to <path> as a .dot file viewable with GraphViz">,
982 def keep_relocs : Flag<["-"], "keep_relocs">,
983 HelpText<"Retain section-based relocation records in the output, which are ignored at runtime by dyld">,
986 def warn_stabs : Flag<["-"], "warn_stabs">,
987 HelpText<"Warn when bad stab symbols inside a BINCL/EINCL prevent optimization">,
990 def warn_commons : Flag<["-"], "warn_commons">,
991 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">,
994 def read_only_stubs : Flag<["-"], "read_only_stubs">,
995 HelpText<"On i386, make the __IMPORT segment of a final linked image read-only">,
998 def interposable_list : Separate<["-"], "interposable_list">,
999 MetaVarName<"<path>">,
1000 HelpText<"Access global symbols listed in <path> indirectly">,
1001 Flags<[HelpHidden]>,
1003 def no_function_starts : Flag<["-"], "no_function_starts">,
1004 HelpText<"Do not create table of function start addresses">,
1006 def object_path_lto : Separate<["-"], "object_path_lto">,
1007 MetaVarName<"<path>">,
1008 HelpText<"Retain any temporary mach-o file in <path> that would otherwise be deleted during LTO">,
1010 def cache_path_lto : Separate<["-"], "cache_path_lto">,
1011 MetaVarName<"<path>">,
1012 HelpText<"Use <path> as a directory for the incremental LTO cache">,
1014 def prune_interval_lto : Separate<["-"], "prune_interval_lto">,
1015 MetaVarName<"<seconds>">,
1016 HelpText<"Prune the incremental LTO cache after <seconds> (-1 disables pruning)">,
1018 def prune_after_lto : Separate<["-"], "prune_after_lto">,
1019 MetaVarName<"<seconds>">,
1020 HelpText<"Remove LTO cache entries after <seconds>">,
1022 def max_relative_cache_size_lto : Separate<["-"], "max_relative_cache_size_lto">,
1023 MetaVarName<"<percent>">,
1024 HelpText<"Limit the incremental LTO cache growth to <percent> of free disk, space">,
1026 def page_align_data_atoms : Flag<["-"], "page_align_data_atoms">,
1027 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">,
1028 Flags<[HelpHidden]>,
1030 def not_for_dyld_shared_cache : Flag<["-"], "not_for_dyld_shared_cache">,
1031 HelpText<"Prevent system dylibs from being placed into the dylib shared cache">,
1032 Flags<[HelpHidden]>,
1034 def mllvm : Separate<["-"], "mllvm">,
1035 HelpText<"Options to pass to LLVM">,
1037 def mcpu : Separate<["-"], "mcpu">,
1038 HelpText<"Processor family target for LTO code generation">,
1040 def no_dtrace_dof : Flag<["-"], "no_dtrace_dof">,
1041 HelpText<"Disable dtrace-dof processing (default).">,
1043 def objc_stubs_fast : Flag<["-"], "objc_stubs_fast">,
1044 HelpText<"Produce larger stubs for Objective-C method calls with fewer jumps (default).">,
1046 def objc_stubs_small : Flag<["-"], "objc_stubs_small">,
1047 HelpText<"Produce smaller stubs for Objective-C method calls with more jumps.">,
1049 def dyld_env : Separate<["-"], "dyld_env">,
1050 MetaVarName<"<dyld_env_var>">,
1051 HelpText<"Specifies a LC_DYLD_ENVIRONMENT variable value pair.">,
1053 def ignore_auto_link : Flag<["-"], "ignore_auto_link">,
1054 HelpText<"Ignore LC_LINKER_OPTIONs">,
1057 def grp_deprecated : OptionGroup<"deprecated">, HelpText<"DEPRECATED">;
1059 def lazy_framework : Separate<["-"], "lazy_framework">,
1060 MetaVarName<"<name>">,
1061 HelpText<"This option is deprecated and is now an alias for -framework.">,
1062 Flags<[HelpHidden]>,
1063 Group<grp_deprecated>;
1064 def lazy_library : Separate<["-"], "lazy_library">,
1065 MetaVarName<"<path>">,
1066 HelpText<"This option is deprecated and is now an alias for regular linking">,
1067 Flags<[HelpHidden]>,
1068 Group<grp_deprecated>;
1069 def lazy_l : Joined<["-"], "lazy-l">,
1070 MetaVarName<"<name>">,
1071 HelpText<"This option is deprecated and is now an alias for -l<path>.">,
1072 Flags<[HelpHidden]>,
1073 Group<grp_deprecated>;
1074 def single_module : Flag<["-"], "single_module">,
1075 HelpText<"Unnecessary option: this is already the default">,
1076 Flags<[HelpHidden]>,
1077 Group<grp_deprecated>;
1078 def no_dead_strip_inits_and_terms : Flag<["-"], "no_dead_strip_inits_and_terms">,
1079 HelpText<"Unnecessary option: initialization and termination are roots of the dead strip graph, so never dead stripped">,
1080 Flags<[HelpHidden]>,
1081 Group<grp_deprecated>;
1083 def grp_obsolete : OptionGroup<"obsolete">, HelpText<"OBSOLETE">;
1085 def sectorder : MultiArg<["-"], "sectorder", 3>,
1086 MetaVarName<"<segname> <sectname> <orderfile>">,
1087 HelpText<"Obsolete. Replaced by more general -order_file option">,
1088 Group<grp_obsolete>;
1089 def lto_library : Separate<["-"], "lto_library">,
1090 MetaVarName<"<path>">,
1091 HelpText<"Obsolete. LLD supports LTO directly, without using an external dylib.">,
1092 Group<grp_obsolete>;
1093 def y : Joined<["-"], "y">,
1094 MetaVarName<"<symbol>">,
1095 HelpText<"This option is obsolete in ld64">,
1096 Flags<[HelpHidden]>,
1097 Group<grp_obsolete>;
1098 def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>,
1099 MetaVarName<"<segname> <sectname>">,
1100 HelpText<"This option is obsolete in ld64">,
1101 Flags<[HelpHidden]>,
1102 Group<grp_obsolete>;
1103 def nofixprebinding : Flag<["-"], "nofixprebinding">,
1104 HelpText<"This option is obsolete in ld64">,
1105 Flags<[HelpHidden]>,
1106 Group<grp_obsolete>;
1107 def noprebind_all_twolevel_modules : Flag<["-"], "noprebind_all_twolevel_modules">,
1108 HelpText<"This option is obsolete in ld64">,
1109 Flags<[HelpHidden]>,
1110 Group<grp_obsolete>;
1111 def prebind_all_twolevel_modules : Flag<["-"], "prebind_all_twolevel_modules">,
1112 HelpText<"This option is obsolete in ld64">,
1113 Flags<[HelpHidden]>,
1114 Group<grp_obsolete>;
1115 def prebind_allow_overlap : Flag<["-"], "prebind_allow_overlap">,
1116 HelpText<"This option is obsolete in ld64">,
1117 Flags<[HelpHidden]>,
1118 Group<grp_obsolete>;
1119 def noprebind : Flag<["-"], "noprebind">,
1120 HelpText<"This option is obsolete in ld64">,
1121 Flags<[HelpHidden]>,
1122 Group<grp_obsolete>;
1123 def sect_diff_relocs : Separate<["-"], "sect_diff_relocs">,
1124 MetaVarName<"<treatment>">,
1125 HelpText<"This option is obsolete in ld64">,
1126 Flags<[HelpHidden]>,
1127 Group<grp_obsolete>;
1128 def A : Separate<["-"], "A">,
1129 MetaVarName<"<basefile>">,
1130 HelpText<"This option is obsolete in ld64">,
1131 Flags<[HelpHidden]>,
1132 Group<grp_obsolete>;
1133 def b : Flag<["-"], "b">,
1134 HelpText<"This option is obsolete in ld64">,
1135 Flags<[HelpHidden]>,
1136 Group<grp_obsolete>;
1137 def Sn : Flag<["-"], "Sn">,
1138 HelpText<"This option is obsolete in ld64">,
1139 Flags<[HelpHidden]>,
1140 Group<grp_obsolete>;
1141 def Si : Flag<["-"], "Si">,
1142 HelpText<"This option is obsolete in ld64">,
1143 Flags<[HelpHidden]>,
1144 Group<grp_obsolete>;
1145 def Sp : Flag<["-"], "Sp">,
1146 HelpText<"This option is obsolete in ld64">,
1147 Flags<[HelpHidden]>,
1148 Group<grp_obsolete>;
1149 def X : Flag<["-"], "X">,
1150 HelpText<"This option is obsolete in ld64">,
1151 Flags<[HelpHidden]>,
1152 Group<grp_obsolete>;
1153 def s : Flag<["-"], "s">,
1154 HelpText<"This option is obsolete in ld64">,
1155 Flags<[HelpHidden]>,
1156 Group<grp_obsolete>;
1157 def m : Flag<["-"], "m">,
1158 HelpText<"This option is obsolete in ld64">,
1159 Flags<[HelpHidden]>,
1160 Group<grp_obsolete>;
1161 def Y : Separate<["-"], "Y">,
1162 MetaVarName<"<number>">,
1163 HelpText<"This option is obsolete in ld64">,
1164 Flags<[HelpHidden]>,
1165 Group<grp_obsolete>;
1166 def nomultidefs : Flag<["-"], "nomultidefs">,
1167 HelpText<"This option is obsolete in ld64">,
1168 Flags<[HelpHidden]>,
1169 Group<grp_obsolete>;
1170 def multiply_defined_unused : Separate<["-"], "multiply_defined_unused">,
1171 MetaVarName<"<treatment>">,
1172 HelpText<"This option is obsolete in ld64">,
1173 Flags<[HelpHidden]>,
1174 Group<grp_obsolete>;
1175 def multiply_defined : Separate<["-"], "multiply_defined">,
1176 MetaVarName<"<treatment>">,
1177 HelpText<"This option is obsolete in ld64">,
1178 Flags<[HelpHidden]>,
1179 Group<grp_obsolete>;
1180 def private_bundle : Flag<["-"], "private_bundle">,
1181 HelpText<"This option is obsolete in ld64">,
1182 Flags<[HelpHidden]>,
1183 Group<grp_obsolete>;
1184 def seg_addr_table_filename : Separate<["-"], "seg_addr_table_filename">,
1185 MetaVarName<"<path>">,
1186 HelpText<"This option is obsolete in ld64">,
1187 Flags<[HelpHidden]>,
1188 Group<grp_obsolete>;
1189 def sectorder_detail : Flag<["-"], "sectorder_detail">,
1190 HelpText<"This option is obsolete in ld64">,
1191 Flags<[HelpHidden]>,
1192 Group<grp_obsolete>;
1193 def no_compact_linkedit : Flag<["-"], "no_compact_linkedit">,
1194 HelpText<"This option is obsolete in ld64">,
1195 Flags<[HelpHidden]>,
1196 Group<grp_obsolete>;
1197 def dependent_dr_info : Flag<["-"], "dependent_dr_info">,
1198 HelpText<"This option is obsolete in ld64">,
1199 Flags<[HelpHidden]>,
1200 Group<grp_obsolete>;
1201 def no_dependent_dr_info : Flag<["-"], "no_dependent_dr_info">,
1202 HelpText<"This option is obsolete in ld64">,
1203 Flags<[HelpHidden]>,
1204 Group<grp_obsolete>;
1205 def seglinkedit : Flag<["-"], "seglinkedit">,
1206 HelpText<"This option is obsolete in ld64">,
1207 Flags<[HelpHidden]>,
1208 Group<grp_obsolete>;
1209 def noseglinkedit : Flag<["-"], "noseglinkedit">,
1210 HelpText<"This option is obsolete in ld64">,
1211 Flags<[HelpHidden]>,
1212 Group<grp_obsolete>;
1213 def fvmlib : Flag<["-"], "fvmlib">,
1214 HelpText<"This option is obsolete in ld64">,
1215 Flags<[HelpHidden]>,
1216 Group<grp_obsolete>;
1217 def run_init_lazily : Flag<["-"], "run_init_lazily">,
1218 HelpText<"This option is obsolete in ld64">,
1219 Flags<[HelpHidden]>,
1220 Group<grp_obsolete>;
1221 def prebind : Flag<["-"], "prebind">,
1222 HelpText<"This option is obsolete in ld64">,
1223 Flags<[HelpHidden]>,
1224 Group<grp_obsolete>;
1225 def twolevel_namespace_hints : Flag<["-"], "twolevel_namespace_hints">,
1226 HelpText<"This option is obsolete in ld64">,
1227 Flags<[HelpHidden]>,
1228 Group<grp_obsolete>;
1229 def slow_stubs : Flag<["-"], "slow_stubs">,
1230 HelpText<"This option is obsolete in ld64">,
1231 Flags<[HelpHidden]>,
1232 Group<grp_obsolete>;
1234 def bitcode_bundle : Flag<["-"], "bitcode_bundle">,
1235 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1236 Flags<[HelpHidden]>,
1237 Group<grp_obsolete>;
1238 def bitcode_hide_symbols : Flag<["-"], "bitcode_hide_symbols">,
1239 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1240 Flags<[HelpHidden]>,
1241 Group<grp_obsolete>;
1242 def bitcode_symbol_map : Separate<["-"], "bitcode_symbol_map">,
1243 MetaVarName<"<path>">,
1244 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1245 Flags<[HelpHidden]>,
1246 Group<grp_obsolete>;
1247 def bitcode_process_mode : Separate<["-"], "bitcode_process_mode">,
1248 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1249 Flags<[HelpHidden]>,
1250 Group<grp_obsolete>;
1251 def bitcode_verify : Flag<["-"], "bitcode_verify">,
1252 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1253 Flags<[HelpHidden]>,
1254 Group<grp_obsolete>;
1256 def grp_undocumented : OptionGroup<"undocumented">, HelpText<"UNDOCUMENTED">;
1258 def add_linker_option : Flag<["-"], "add_linker_option">,
1259 HelpText<"This option is undocumented in ld64">,
1260 Flags<[HelpHidden]>,
1261 Group<grp_undocumented>;
1262 def add_source_version : Flag<["-"], "add_source_version">,
1263 HelpText<"This option is undocumented in ld64">,
1264 Flags<[HelpHidden]>,
1265 Group<grp_undocumented>;
1266 def no_source_version : Flag<["-"], "no_source_version">,
1267 HelpText<"This option is undocumented in ld64">,
1268 Flags<[HelpHidden]>,
1269 Group<grp_undocumented>;
1270 def add_split_seg_info : Flag<["-"], "add_split_seg_info">,
1271 HelpText<"This option is undocumented in ld64">,
1272 Flags<[HelpHidden]>,
1273 Group<grp_undocumented>;
1274 def allow_dead_duplicates : Flag<["-"], "allow_dead_duplicates">,
1275 HelpText<"This option is undocumented in ld64">,
1276 Flags<[HelpHidden]>,
1277 Group<grp_undocumented>;
1278 def allow_simulator_linking_to_macosx_dylibs : Flag<["-"], "allow_simulator_linking_to_macosx_dylibs">,
1279 HelpText<"This option is undocumented in ld64">,
1280 Flags<[HelpHidden]>,
1281 Group<grp_undocumented>;
1282 def classic_linker : Flag<["-"], "classic_linker">,
1283 HelpText<"This option is undocumented in ld64">,
1284 Flags<[HelpHidden]>,
1285 Group<grp_undocumented>;
1286 def data_in_code_info : Flag<["-"], "data_in_code_info">,
1287 HelpText<"Emit data-in-code information (default)">,
1288 Group<grp_undocumented>;
1289 def no_data_in_code_info : Flag<["-"], "no_data_in_code_info">,
1290 HelpText<"Do not emit data-in-code information">,
1291 Group<grp_undocumented>;
1292 def debug_snapshot : Flag<["-"], "debug_snapshot">,
1293 HelpText<"This option is undocumented in ld64">,
1294 Flags<[HelpHidden]>,
1295 Group<grp_undocumented>;
1296 def demangle : Flag<["-"], "demangle">,
1297 HelpText<"Demangle symbol names in diagnostics">;
1298 def encryptable : Flag<["-"], "encryptable">,
1299 HelpText<"Generate the LC_ENCRYPTION_INFO load command">,
1300 Group<grp_undocumented>;
1301 def no_encryption : Flag<["-"], "no_encryption">,
1302 HelpText<"Do not generate the LC_ENCRYPTION_INFO load command">,
1303 Group<grp_undocumented>;
1304 def executable_path : Flag<["-"], "executable_path">,
1305 HelpText<"This option is undocumented in ld64">,
1306 Flags<[HelpHidden]>,
1307 Group<grp_undocumented>;
1308 def fixup_chains : Flag<["-"], "fixup_chains">,
1309 HelpText<"Emit chained fixups">,
1310 Group<grp_undocumented>;
1311 def no_fixup_chains : Flag<["-"], "no_fixup_chains">,
1312 HelpText<"Emit fixup information as classic dyld opcodes">,
1313 Group<grp_undocumented>;
1314 def fixup_chains_section : Flag<["-"], "fixup_chains_section">,
1315 HelpText<"This option is undocumented in ld64">,
1316 Flags<[HelpHidden]>,
1317 Group<grp_undocumented>;
1318 def objc_relative_method_lists : Flag<["-"], "objc_relative_method_lists">,
1319 HelpText<"Emit relative method lists (more compact representation)">,
1320 Group<grp_undocumented>;
1321 def no_objc_relative_method_lists : Flag<["-"], "no_objc_relative_method_lists">,
1322 HelpText<"Don't emit relative method lists (use traditional representation)">,
1323 Group<grp_undocumented>;
1324 def flto_codegen_only : Flag<["-"], "flto-codegen-only">,
1325 HelpText<"This option is undocumented in ld64">,
1326 Flags<[HelpHidden]>,
1327 Group<grp_undocumented>;
1328 def force_symbol_not_weak : Flag<["-"], "force_symbol_not_weak">,
1329 HelpText<"This option is undocumented in ld64">,
1330 Flags<[HelpHidden]>,
1331 Group<grp_undocumented>;
1332 def force_symbols_coalesce_list : Flag<["-"], "force_symbols_coalesce_list">,
1333 HelpText<"This option is undocumented in ld64">,
1334 Flags<[HelpHidden]>,
1335 Group<grp_undocumented>;
1336 def force_symbols_not_weak_list : Separate<["-"], "force_symbols_not_weak_list">,
1337 HelpText<"This option is undocumented in ld64">,
1338 Flags<[HelpHidden]>,
1339 Group<grp_undocumented>;
1340 def force_symbols_weak_list : Separate<["-"], "force_symbols_weak_list">,
1341 HelpText<"This option is undocumented in ld64">,
1342 Flags<[HelpHidden]>,
1343 Group<grp_undocumented>;
1344 def force_symbol_weak : Flag<["-"], "force_symbol_weak">,
1345 HelpText<"This option is undocumented in ld64">,
1346 Flags<[HelpHidden]>,
1347 Group<grp_undocumented>;
1348 def function_starts : Flag<["-"], "function_starts">,
1349 HelpText<"Create table of function start addresses (default)">,
1350 Group<grp_undocumented>;
1351 def i : Flag<["-"], "i">,
1352 HelpText<"This option is undocumented in ld64">,
1353 Flags<[HelpHidden]>,
1354 Group<grp_undocumented>;
1355 def ignore_optimization_hints : Flag<["-"], "ignore_optimization_hints">,
1356 HelpText<"Ignore Linker Optimization Hints">,
1357 Group<grp_undocumented>;
1358 def init_offsets : Flag<["-"], "init_offsets">,
1359 HelpText<"Store __TEXT segment offsets of static initializers">,
1360 Group<grp_undocumented>;
1361 def keep_dwarf_unwind : Flag<["-"], "keep_dwarf_unwind">,
1362 HelpText<"This option is undocumented in ld64">,
1363 Flags<[HelpHidden]>,
1364 Group<grp_undocumented>;
1365 def no_keep_dwarf_unwind : Flag<["-"], "no_keep_dwarf_unwind">,
1366 HelpText<"This option is undocumented in ld64">,
1367 Flags<[HelpHidden]>,
1368 Group<grp_undocumented>;
1369 def kext : Flag<["-"], "kext">,
1370 HelpText<"This option is undocumented in ld64">,
1371 Flags<[HelpHidden]>,
1372 Group<grp_undocumented>;
1373 def kext_objects_dir : Flag<["-"], "kext_objects_dir">,
1374 HelpText<"This option is undocumented in ld64">,
1375 Flags<[HelpHidden]>,
1376 Group<grp_undocumented>;
1377 def no_kext_objects : Flag<["-"], "no_kext_objects">,
1378 HelpText<"This option is undocumented in ld64">,
1379 Flags<[HelpHidden]>,
1380 Group<grp_undocumented>;
1381 def kexts_use_stubs : Flag<["-"], "kexts_use_stubs">,
1382 HelpText<"This option is undocumented in ld64">,
1383 Flags<[HelpHidden]>,
1384 Group<grp_undocumented>;
1385 def no_compact_unwind : Flag<["-"], "no_compact_unwind">,
1386 HelpText<"This option is undocumented in ld64">,
1387 Flags<[HelpHidden]>,
1388 Group<grp_undocumented>;
1389 def no_new_main : Flag<["-"], "no_new_main">,
1390 HelpText<"This option is undocumented in ld64">,
1391 Flags<[HelpHidden]>,
1392 Group<grp_undocumented>;
1393 def pause : Flag<["-"], "pause">,
1394 HelpText<"This option is undocumented in ld64">,
1395 Flags<[HelpHidden]>,
1396 Group<grp_undocumented>;
1397 def random_uuid : Flag<["-"], "random_uuid">,
1398 HelpText<"This option is undocumented in ld64">,
1399 Flags<[HelpHidden]>,
1400 Group<grp_undocumented>;
1401 def simulator_support : Flag<["-"], "simulator_support">,
1402 HelpText<"This option is undocumented in ld64">,
1403 Flags<[HelpHidden]>,
1404 Group<grp_undocumented>;
1405 def snapshot_dir : Flag<["-"], "snapshot_dir">,
1406 HelpText<"This option is undocumented in ld64">,
1407 Flags<[HelpHidden]>,
1408 Group<grp_undocumented>;
1409 def source_version : Flag<["-"], "source_version">,
1410 HelpText<"This option is undocumented in ld64">,
1411 Flags<[HelpHidden]>,
1412 Group<grp_undocumented>;
1413 def threaded_starts_section : Flag<["-"], "threaded_starts_section">,
1414 HelpText<"This option is undocumented in ld64">,
1415 Flags<[HelpHidden]>,
1416 Group<grp_undocumented>;
1417 def verbose_optimization_hints : Flag<["-"], "verbose_optimization_hints">,
1418 HelpText<"This option is undocumented in ld64">,
1419 Flags<[HelpHidden]>,
1420 Group<grp_undocumented>;
1421 def version_load_command : Flag<["-"], "version_load_command">,
1422 HelpText<"This option is undocumented in ld64">,
1423 Flags<[HelpHidden]>,
1424 Group<grp_undocumented>;
1426 def grp_ignored : OptionGroup<"ignored">, HelpText<"IGNORED">;
1428 def M : Flag<["-"], "M">,
1429 HelpText<"This option is ignored in ld64">,
1430 Flags<[HelpHidden]>,
1432 def new_linker : Flag<["-"], "new_linker">,
1433 HelpText<"This option is ignored in ld64">,
1434 Flags<[HelpHidden]>,
1437 def grp_ignored_silently : OptionGroup<"ignored_silently">, HelpText<"IGNORED SILENTLY">;
1439 def objc_abi_version : Separate<["-"], "objc_abi_version">,
1440 HelpText<"This option only applies to i386 in ld64">,
1441 Flags<[HelpHidden]>,
1442 Group<grp_ignored_silently>;
1443 def debug_variant : Flag<["-"], "debug_variant">,
1444 HelpText<"Do not warn about issues that are only problems for binaries shipping to customers.">,
1445 Flags<[HelpHidden]>,
1446 Group<grp_ignored_silently>;
1448 // NOTE: This flag should be respected if -warn_duplicate_libraries is ever implemented.
1449 def no_warn_duplicate_libraries : Flag<["-"], "no_warn_duplicate_libraries">,
1450 HelpText<"Do not warn if the input contains duplicate library options.">,
1451 Flags<[HelpHidden]>,
1452 Group<grp_ignored_silently>;