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 lto_newpm_passes: Joined<["--"], "lto-newpm-passes=">,
166 HelpText<"Passes to run during LTO">, Group<grp_lld>;
167 def load_pass_plugins : Separate<["--"], "load-pass-plugin">, Group<grp_lld>;
168 def load_pass_plugins_eq : Joined<["--"], "load-pass-plugin=">,
169 Alias<!cast<Separate>(load_pass_plugins)>,
170 HelpText<"Load passes from plugin library">, Group<grp_lld>;
171 def codegen_data_generate_path : Separate<["--"], "codegen-data-generate-path">, Group<grp_lld>;
172 def codegen_data_generate_path_eq : Joined<["--"], "codegen-data-generate-path=">,
173 Alias<!cast<Separate>(codegen_data_generate_path)>, MetaVarName<"<cgdata>">,
174 HelpText<"Write the CG data to the specified path <cgdata>.">, Group<grp_lld>;
175 def cs_profile_generate: Flag<["--"], "cs-profile-generate">,
176 HelpText<"Perform context sensitive PGO instrumentation">, Group<grp_lld>;
177 def cs_profile_path: Joined<["--"], "cs-profile-path=">,
178 HelpText<"Context sensitive profile file path">, Group<grp_lld>;
179 defm pgo_warn_mismatch: BB<"pgo-warn-mismatch",
180 "turn on warnings about profile cfg mismatch (default)",
181 "turn off warnings about profile cfg mismatch">, Group<grp_lld>;
182 defm warn_thin_archive_missing_members : BB<"warn-thin-archive-missing-members",
183 "Warn on missing object files referenced by thin archives (default)",
184 "Do not warn on missing object files referenced by thin archives">, Group<grp_lld>;
186 // This is a complete Options.td compiled from Apple's ld(1) manpage
187 // dated 2018-03-07 and cross checked with ld64 source code in repo
188 // https://github.com/apple-opensource/ld64 at git tag "512.4" dated
191 // Flags<[HelpHidden]> marks options that are not yet ported to lld,
192 // and serve as a scoreboard for annotating our progress toward
193 // implementing ld64 options in lld. As you add implementions to
194 // Driver.cpp, please remove the hidden flag here.
196 def grp_kind : OptionGroup<"kind">, HelpText<"OUTPUT KIND">;
198 def execute : Flag<["-"], "execute">,
199 HelpText<"Produce a main executable (default)">,
201 def dylib : Flag<["-"], "dylib">,
202 HelpText<"Produce a shared library">,
204 def bundle : Flag<["-"], "bundle">,
205 HelpText<"Produce a bundle">,
207 def r : Flag<["-"], "r">,
208 HelpText<"Merge multiple object files into one, retaining relocations">,
211 def dylinker : Flag<["-"], "dylinker">,
212 HelpText<"Produce a dylinker only used when building dyld">,
215 def dynamic : Flag<["-"], "dynamic">,
216 HelpText<"Link dynamically (default)">,
218 def static : Flag<["-"], "static">,
219 HelpText<"Link statically">,
222 def preload : Flag<["-"], "preload">,
223 HelpText<"Produce an unsegmented binary for embedded systems">,
226 def arch : Separate<["-"], "arch">,
227 MetaVarName<"<arch_name>">,
228 HelpText<"The architecture (e.g. ppc, ppc64, i386, x86_64)">,
230 def o : Separate<["-"], "o">,
231 MetaVarName<"<path>">,
232 HelpText<"The name of the output file (default: `a.out')">,
235 def grp_libs : OptionGroup<"libs">, HelpText<"LIBRARIES">;
237 def l : Joined<["-"], "l">,
238 MetaVarName<"<name>">,
239 HelpText<"Search for lib<name>.dylib or lib<name>.a on the library search path">,
241 def weak_l : Joined<["-"], "weak-l">,
242 MetaVarName<"<name>">,
243 HelpText<"Like -l<name>, but mark library and its references as weak imports">,
245 def weak_library : Separate<["-"], "weak_library">,
246 MetaVarName<"<path>">,
247 HelpText<"Like bare <path>, but mark library and its references as weak imports">,
249 def needed_l : Joined<["-"], "needed-l">,
250 MetaVarName<"<name>">,
251 HelpText<"Like -l<name>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
253 def needed_library : Separate<["-"], "needed_library">,
254 MetaVarName<"<path>">,
255 HelpText<"Like bare <path>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
257 def reexport_l : Joined<["-"], "reexport-l">,
258 MetaVarName<"<name>">,
259 HelpText<"Like -l<name>, but export all symbols of <name> from newly created library">,
261 def reexport_library : Separate<["-"], "reexport_library">,
262 MetaVarName<"<path>">,
263 HelpText<"Like bare <path>, but export all symbols of <path> from newly created library">,
265 def upward_l : Joined<["-"], "upward-l">,
266 MetaVarName<"<name>">,
267 HelpText<"Like -l<name>, but specify dylib as an upward dependency">,
270 def upward_library : Separate<["-"], "upward_library">,
271 MetaVarName<"<path>">,
272 HelpText<"Like bare <path>, but specify dylib as an upward dependency">,
275 def L : JoinedOrSeparate<["-"], "L">,
276 MetaVarName<"<dir>">,
277 HelpText<"Add dir to the library search path">,
279 def Z : Flag<["-"], "Z">,
280 HelpText<"Remove standard directories from the library and framework search paths">,
282 def syslibroot : Separate<["-"], "syslibroot">,
283 MetaVarName<"<rootdir>">,
284 HelpText<"Prepend <rootdir> to all library and framework search paths">,
286 def search_paths_first : Flag<["-"], "search_paths_first">,
287 HelpText<"Search for lib<name>.dylib and lib<name>.a at each step in traversing search path (default for Xcode 4 and later)">,
289 def search_dylibs_first : Flag<["-"], "search_dylibs_first">,
290 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)">,
292 def framework : Separate<["-"], "framework">,
293 MetaVarName<"<name>">,
294 HelpText<"Search for <name>.framework/<name> on the framework search path">,
296 def weak_framework : Separate<["-"], "weak_framework">,
297 MetaVarName<"<name>">,
298 HelpText<"Like -framework <name>, but mark framework and its references as weak imports">,
300 def needed_framework : Separate<["-"], "needed_framework">,
301 MetaVarName<"<name>">,
302 HelpText<"Like -framework <name>, but link <name> even if none of its symbols are used and -dead_strip_dylibs is active">,
304 def reexport_framework : Separate<["-"], "reexport_framework">,
305 MetaVarName<"<name>">,
306 HelpText<"Like -framework <name>, but export all symbols of <name> from the newly created library">,
308 def upward_framework : Separate<["-"], "upward_framework">,
309 MetaVarName<"<name>">,
310 HelpText<"Like -framework <name>, but specify the framework as an upward dependency">,
313 def F : JoinedOrSeparate<["-"], "F">,
314 MetaVarName<"<dir>">,
315 HelpText<"Add dir to the framework search path">,
317 def all_load : Flag<["-"], "all_load">,
318 HelpText<"Load all members of all static archive libraries">,
320 def noall_load : Flag<["-"], "noall_load">,
321 HelpText<"Don't load all static members from archives, this is the default, this negates -all_load">,
323 def ObjC : Flag<["-"], "ObjC">,
324 HelpText<"Load all members of static archives that are an Objective-C class or category.">,
326 def force_load : Separate<["-"], "force_load">,
327 MetaVarName<"<path>">,
328 HelpText<"Load all members static archive library at <path>">,
330 def force_load_swift_libs : Flag<["-"], "force_load_swift_libs">,
331 HelpText<"Apply -force_load to libraries listed in LC_LINKER_OPTIONS whose names start with 'swift'">,
333 def load_hidden : Separate<["-"], "load_hidden">,
334 MetaVarName<"<path>">,
335 HelpText<"Load all symbols from static library with hidden visibility">,
337 def hidden_l : Joined<["-"], "hidden-l">,
338 MetaVarName<"<name>">,
339 HelpText<"Like -l<name>, but load all symbols with hidden visibility">,
342 def grp_content : OptionGroup<"content">, HelpText<"ADDITIONAL CONTENT">;
344 def sectcreate : MultiArg<["-"], "sectcreate", 3>,
345 MetaVarName<"<segment> <section> <file>">,
346 HelpText<"Create <section> in <segment> from the contents of <file>">,
348 def segcreate : MultiArg<["-"], "segcreate", 3>,
349 MetaVarName<"<segment> <section> <file>">,
351 HelpText<"Alias for -sectcreate">,
353 def add_empty_section : MultiArg<["-"], "add_empty_section", 2>,
354 MetaVarName<"<segment> <section>">,
355 HelpText<"Create an empty <section> in <segment>">,
357 def filelist : Separate<["-"], "filelist">,
358 MetaVarName<"<file>">,
359 HelpText<"Read names of files to link from <file>">,
361 def dtrace : Separate<["-"], "dtrace">,
362 MetaVarName<"<script>">,
363 HelpText<"Enable DTrace static probes according to declarations in <script>">,
367 def grp_opts : OptionGroup<"opts">, HelpText<"OPTIMIZATIONS">;
369 def dead_strip : Flag<["-"], "dead_strip">,
370 HelpText<"Remove unreachable functions and data">,
372 def order_file : Separate<["-"], "order_file">,
373 MetaVarName<"<file>">,
374 HelpText<"Layout functions and data according to specification in <file>">,
376 def no_order_inits : Flag<["-"], "no_order_inits">,
377 HelpText<"Disable default reordering of initializer and terminator functions">,
380 def no_order_data : Flag<["-"], "no_order_data">,
381 HelpText<"Disable default reordering of global data accessed at launch time">,
384 def image_base : Separate<["-"], "image_base">,
385 MetaVarName<"<address>">,
386 HelpText<"Preferred hex load address for a dylib or bundle.">,
389 def seg1addr : Separate<["-"], "seg1addr">,
390 MetaVarName<"<address>">,
392 HelpText<"Alias for -image_base">,
395 def no_implicit_dylibs : Flag<["-"], "no_implicit_dylibs">,
396 HelpText<"Do not optimize public dylib transitive symbol references">,
398 def exported_symbols_order : Separate<["-"], "exported_symbols_order">,
399 MetaVarName<"<file>">,
400 HelpText<"Specify frequently-used symbols in <file> to optimize symbol exports">,
403 def no_zero_fill_sections : Flag<["-"], "no_zero_fill_sections">,
404 HelpText<"Explicitly store zeroed data in the final image">,
407 def merge_zero_fill_sections : Flag<["-"], "merge_zero_fill_sections">,
408 HelpText<"Merge all zeroed data into the __zerofill section">,
411 def no_branch_islands : Flag<["-"], "no_branch_islands">,
412 HelpText<"Disable infra for branches beyond the maximum branch distance.">,
415 def no_deduplicate : Flag<["-"], "no_deduplicate">,
416 HelpText<"Disable code deduplication (synonym for `--icf=none')">,
417 Alias<icf_eq>, AliasArgs<["none"]>,
420 def grp_version : OptionGroup<"version">, HelpText<"VERSION TARGETING">;
422 def platform_version : MultiArg<["-"], "platform_version", 3>,
423 MetaVarName<"<platform> <min_version> <sdk_version>">,
424 HelpText<"Platform (e.g., macos, ios, tvos, watchos, xros, bridgeos, mac-catalyst, ios-sim, tvos-sim, watchos-sim, xros-sim, driverkit) and version numbers">,
426 def sdk_version : Separate<["-"], "sdk_version">,
427 HelpText<"This option is undocumented in ld64">,
430 def macos_version_min : Separate<["-"], "macos_version_min">,
431 MetaVarName<"<version>">,
432 HelpText<"Oldest macOS version for which linked output is usable">,
434 def macosx_version_min : Separate<["-"], "macosx_version_min">,
435 MetaVarName<"<version>">,
436 Alias<macos_version_min>,
437 HelpText<"Alias for -macos_version_min">,
440 def ios_version_min : Separate<["-"], "ios_version_min">,
441 MetaVarName<"<version>">,
442 HelpText<"Oldest iOS version for which linked output is usable">,
445 def ios_simulator_version_min : Separate<["-"], "ios_simulator_version_min">,
446 MetaVarName<"<version>">,
447 HelpText<"Oldest iOS simulator version for which linked output is usable">,
450 def iphoneos_version_min : Separate<["-"], "iphoneos_version_min">,
451 MetaVarName<"<version>">,
452 Alias<ios_version_min>,
453 HelpText<"Alias for -ios_version_min">,
456 def maccatalyst_version_min : Separate<["-"], "maccatalyst_version_min">,
457 MetaVarName<"<version>">,
458 HelpText<"Oldest MacCatalyst version for which linked output is usable">,
461 def iosmac_version_min : Separate<["-"], "iosmac_version_min">,
462 MetaVarName<"<version>">,
463 Alias<maccatalyst_version_min>,
464 HelpText<"Alias for -maccatalyst_version_min">,
467 def uikitformac_version_min : Separate<["-"], "uikitformac_version_min">,
468 MetaVarName<"<version>">,
469 Alias<maccatalyst_version_min>,
470 HelpText<"Alias for -maccatalyst_version_min">,
473 def tvos_version_min : Separate<["-"], "tvos_version_min">,
474 MetaVarName<"<version>">,
475 HelpText<"Oldest tvOS version for which linked output is usable">,
478 def watchos_version_min : Separate<["-"], "watchos_version_min">,
479 MetaVarName<"<version>">,
480 HelpText<"Oldest watchOS version for which linked output is usable">,
483 def bridgeos_version_min : Separate<["-"], "bridgeos_version_min">,
484 MetaVarName<"<version>">,
485 HelpText<"Oldest bridgeOS version for which linked output is usable">,
488 def driverkit_version_min : Separate<["-"], "driverkit_version_min">,
489 MetaVarName<"<version>">,
490 HelpText<"Oldest DriverKit version for which linked output is usable">,
494 def grp_dylib : OptionGroup<"dylib">, HelpText<"DYNAMIC LIBRARIES (DYLIB)">;
496 def install_name : Separate<["-"], "install_name">,
497 MetaVarName<"<name>">,
498 HelpText<"Set an internal install path in a dylib">,
500 def dylib_install_name : Separate<["-"], "dylib_install_name">,
501 MetaVarName<"<name>">,
503 HelpText<"Alias for -install_name">,
505 def dylinker_install_name : Separate<["-"], "dylinker_install_name">,
506 MetaVarName<"<name>">,
508 HelpText<"Alias for -install_name">,
510 def mark_dead_strippable_dylib : Flag<["-"], "mark_dead_strippable_dylib">,
511 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">,
513 def compatibility_version : Separate<["-"], "compatibility_version">,
514 MetaVarName<"<version>">,
515 HelpText<"Compatibility <version> of this library">,
517 def dylib_compatibility_version : Separate<["-"], "dylib_compatibility_version">,
518 MetaVarName<"<version>">,
519 Alias<compatibility_version>,
520 HelpText<"Alias for -compatibility_version">,
523 def current_version : Separate<["-"], "current_version">,
524 MetaVarName<"<version>">,
525 HelpText<"Current <version> of this library">,
527 def dylib_current_version : Separate<["-"], "dylib_current_version">,
528 MetaVarName<"<version>">,
529 Alias<current_version>,
530 HelpText<"Alias for -current_version">,
534 def grp_main : OptionGroup<"main">, HelpText<"MAIN EXECUTABLE">;
536 def pie : Flag<["-"], "pie">,
537 HelpText<"Build a position independent executable (default)">,
539 def no_pie : Flag<["-"], "no_pie">,
540 HelpText<"Do not build a position independent executable">,
542 def pagezero_size : Separate<["-"], "pagezero_size">,
543 MetaVarName<"<size>">,
544 HelpText<"Size of unreadable segment at address zero is hex <size> (default is 4KB on 32-bit and 4GB on 64-bit)">,
546 def stack_size : Separate<["-"], "stack_size">,
547 MetaVarName<"<size>">,
548 HelpText<"Maximum hex stack size for the main thread in a program. (default is 8MB)">,
551 def allow_stack_execute : Flag<["-"], "allow_stack_execute">,
552 HelpText<"Mark stack segment as executable">,
555 def export_dynamic : Flag<["-"], "export_dynamic">,
556 HelpText<"Preserve all global symbols during LTO and when dead-stripping executables">,
559 def grp_bundle : OptionGroup<"bundle">, HelpText<"CREATING A BUNDLE">;
561 def bundle_loader : Separate<["-"], "bundle_loader">,
562 MetaVarName<"<executable>">,
563 HelpText<"Resolve undefined symbols from <executable>">,
566 def grp_object : OptionGroup<"object">, HelpText<"CREATING AN OBJECT FILE">;
568 def keep_private_externs : Flag<["-"], "keep_private_externs">,
569 HelpText<"Do not convert private external symbols to static symbols (only valid with -r)">,
572 def d : Flag<["-"], "d">,
573 HelpText<"Force tentative into real definitions for common symbols">,
577 def grp_resolve : OptionGroup<"resolve">, HelpText<"SYMBOL RESOLUTION">;
579 def exported_symbol : Separate<["-"], "exported_symbol">,
580 MetaVarName<"<symbol>">,
581 HelpText<"<symbol> remains global, while others become private externs">,
583 def exported_symbols_list : Separate<["-"], "exported_symbols_list">,
584 MetaVarName<"<file>">,
585 HelpText<"Symbols specified in <file> remain global, while others become private externs">,
587 def no_exported_symbols : Flag<["-"], "no_exported_symbols">,
588 HelpText<"Don't export any symbols from the binary, useful for main executables that don't have plugins">,
590 def unexported_symbol : Separate<["-"], "unexported_symbol">,
591 MetaVarName<"<symbol>">,
592 HelpText<"Global <symbol> becomes private extern">,
594 def unexported_symbols_list : Separate<["-"], "unexported_symbols_list">,
595 MetaVarName<"<file>">,
596 HelpText<"Global symbols specified in <file> become private externs">,
598 def reexported_symbols_list : Separate<["-"], "reexported_symbols_list">,
599 MetaVarName<"<file>">,
600 HelpText<"Symbols from dependent dylibs specified in <file> are reexported by this dylib">,
603 def alias : MultiArg<["-"], "alias", 2>,
604 MetaVarName<"<symbol_name> <alternate_name>">,
605 HelpText<"Create a symbol alias with default global visibility">,
607 def alias_list : Separate<["-"], "alias_list">,
608 MetaVarName<"<file>">,
609 HelpText<"Create symbol aliases specified in <file>">,
612 def flat_namespace : Flag<["-"], "flat_namespace">,
613 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">,
615 def twolevel_namespace : Flag<["-"], "twolevel_namespace">,
616 HelpText<"Make dyld look up symbols by (dylib,name) pairs (default)">,
618 def u : Separate<["-"], "u">,
619 MetaVarName<"<symbol>">,
620 HelpText<"Require that <symbol> be defined for the link to succeed">,
622 def U : Separate<["-"], "U">,
623 MetaVarName<"<symbol>">,
624 HelpText<"Allow <symbol> to have no definition">,
626 def undefined : Separate<["-"], "undefined">,
627 MetaVarName<"<treatment>">,
628 HelpText<"Handle undefined symbols according to <treatment>: error, warning, suppress, or dynamic_lookup (default is error)">,
630 def rpath : Separate<["-"], "rpath">,
631 MetaVarName<"<path>">,
632 HelpText<"Add <path> to dyld search list for dylibs with load path prefix `@rpath/'">,
634 def commons : Separate<["-"], "commons">,
635 MetaVarName<"<treatment>">,
636 HelpText<"Resolve tentative definitions in dylibs according to <treatment>: ignore_dylibs, use_dylibs, error (default is ignore_dylibs)">,
640 def grp_introspect : OptionGroup<"introspect">, HelpText<"INTROSPECTING THE LINKER">;
642 def why_load : Flag<["-"], "why_load">,
643 HelpText<"Log why each object file is loaded from a static library">,
644 Group<grp_introspect>;
645 def whyload : Flag<["-"], "whyload">,
647 HelpText<"Alias for -why_load">,
648 Group<grp_introspect>;
649 def why_live : Separate<["-"], "why_live">,
650 MetaVarName<"<symbol>">,
651 HelpText<"Log a chain of references to <symbol>, for use with -dead_strip">,
652 Group<grp_introspect>;
653 def print_statistics : Flag<["-"], "print_statistics">,
654 HelpText<"Log the linker's memory and CPU usage">,
656 Group<grp_introspect>;
657 def t : Flag<["-"], "t">,
658 HelpText<"Log every file the linker loads: object, archive, and dylib">,
659 Group<grp_introspect>;
660 def whatsloaded : Flag<["-"], "whatsloaded">,
661 HelpText<"Logs only the object files the linker loads">,
663 Group<grp_introspect>;
664 def order_file_statistics : Flag<["-"], "order_file_statistics">,
665 HelpText<"Logs information about -order_file">,
667 Group<grp_introspect>;
668 def map : Separate<["-"], "map">,
669 MetaVarName<"<path>">,
670 HelpText<"Writes all symbols and their addresses to <path>">,
671 Group<grp_introspect>;
672 def dependency_info : Separate<["-"], "dependency_info">,
673 MetaVarName<"<path>">,
674 HelpText<"Dump dependency info">,
675 Group<grp_introspect>;
676 def save_temps : Flag<["-"], "save-temps">,
677 HelpText<"Save intermediate LTO compilation results">,
678 Group<grp_introspect>;
680 def grp_symtab : OptionGroup<"symtab">, HelpText<"SYMBOL TABLE">;
682 def S : Flag<["-"], "S">,
683 HelpText<"Strip debug information (STABS or DWARF) from the output">,
685 def x : Flag<["-"], "x">,
686 HelpText<"Exclude non-global symbols from the output symbol table">,
688 def non_global_symbols_strip_list : Separate<["-"], "non_global_symbols_strip_list">,
689 MetaVarName<"<path>">,
690 HelpText<"Specify in <path> the non-global symbols that should be removed from the output symbol table">,
692 def non_global_symbols_no_strip_list : Separate<["-"], "non_global_symbols_no_strip_list">,
693 MetaVarName<"<path>">,
694 HelpText<"Specify in <path> the non-global symbols that should remain in the output symbol table">,
696 def oso_prefix : Separate<["-"], "oso_prefix">,
697 MetaVarName<"<path>">,
698 HelpText<"Remove the prefix <path> from OSO symbols in the debug map">,
700 def add_ast_path : Separate<["-"], "add_ast_path">,
701 MetaVarName<"<path>">,
702 HelpText<"AST paths will be emitted as STABS">,
705 def grp_rare : OptionGroup<"rare">, HelpText<"RARELY USED">;
707 def v : Flag<["-"], "v">,
708 HelpText<"Print the linker version and search paths in addition to linking">,
710 def adhoc_codesign : Flag<["-"], "adhoc_codesign">,
711 HelpText<"Write an ad-hoc code signature to the output file (default for arm64 binaries)">,
713 def no_adhoc_codesign : Flag<["-"], "no_adhoc_codesign">,
714 HelpText<"Do not write an ad-hoc code signature to the output file (default for x86_64 binaries)">,
716 def reproducible : Flag<["-"], "reproducible">,
717 HelpText<"Make the output reproducible by removing timestamps and other non-deterministic data. This is the default behavior.">,
719 def version_details : Flag<["-"], "version_details">,
720 HelpText<"Print the linker version in JSON form">,
723 def no_weak_imports : Flag<["-"], "no_weak_imports">,
724 HelpText<"Fail if any symbols are weak imports, allowed to be NULL at runtime">,
727 def verbose_deduplicate : Flag<["-"], "verbose_deduplicate">,
728 HelpText<"Print function names eliminated by deduplication and the total size of code savings">,
731 def no_inits : Flag<["-"], "no_inits">,
732 HelpText<"Fail if the output contains static initializers">,
735 def no_warn_inits : Flag<["-"], "no_warn_inits">,
736 HelpText<"Suppress warnings for static initializers in the output">,
739 def unaligned_pointers : Separate<["-"], "unaligned_pointers">,
740 MetaVarName<"<treatment>">,
741 HelpText<"Handle unaligned pointers in __DATA segments according to <treatment>: warning, error, or suppress (default for arm64e is error, otherwise suppress)">,
744 def dirty_data_list : Separate<["-"], "dirty_data_list">,
745 MetaVarName<"<path>">,
746 HelpText<"Specify data symbols in <path> destined for the __DATA_DIRTY segment">,
749 def max_default_common_align : Separate<["-"], "max_default_common_align">,
750 MetaVarName<"<boundary>">,
751 HelpText<"Reduce maximum alignment for common symbols to a hex power-of-2 <boundary>">,
754 def move_to_rw_segment : MultiArg<["-"], "move_to_rw_segment", 2>,
755 MetaVarName<"<segment> <path>">,
756 HelpText<"Move data symbols listed in <path> to another <segment>">,
759 def move_to_ro_segment : MultiArg<["-"], "move_to_ro_segment", 2>,
760 MetaVarName<"<segment> <path>">,
761 HelpText<"Move code symbols listed in <path> to another <segment>">,
764 def rename_section : MultiArg<["-"], "rename_section", 4>,
765 MetaVarName<"<from_segment> <from_section> <to_segment> <to_section>">,
766 HelpText<"Rename <from_segment>/<from_section> as <to_segment>/<to_section>">,
768 def rename_segment : MultiArg<["-"], "rename_segment", 2>,
769 MetaVarName<"<from_segment> <to_segment>">,
770 HelpText<"Rename <from_segment> as <to_segment>">,
772 def trace_symbol_layout : Flag<["-"], "trace_symbol_layout">,
773 HelpText<"Show where and why symbols move, as specified by -move_to_ro_segment, -move_to_rw_segment, -rename_section, and -rename_segment">,
776 def data_const : Flag<["-"], "data_const">,
777 HelpText<"Force migration of readonly data into __DATA_CONST segment">,
779 def no_data_const : Flag<["-"], "no_data_const">,
780 HelpText<"Block migration of readonly data away from __DATA segment">,
782 def text_exec : Flag<["-"], "text_exec">,
783 HelpText<"Rename __segment TEXT to __TEXT_EXEC for sections __text and __stubs">,
786 def section_order : MultiArg<["-"], "section_order", 2>,
787 MetaVarName<"<segment> <sections>">,
788 HelpText<"With -preload, specify layout sequence of colon-separated <sections> in <segment>">,
791 def segment_order : Separate<["-"], "segment_order">,
792 MetaVarName<"<colon_separated_segment_list>">,
793 HelpText<"With -preload, specify layout sequence of colon-separated <segments>">,
796 def allow_heap_execute : Flag<["-"], "allow_heap_execute">,
797 HelpText<"On i386, allow any page to execute code">,
800 def application_extension : Flag<["-"], "application_extension">,
801 HelpText<"Mark output as safe for use in an application extension, and validate that linked dylibs are safe">,
803 def no_application_extension : Flag<["-"], "no_application_extension">,
804 HelpText<"Disable application extension functionality (default)">,
806 def fatal_warnings : Flag<["-"], "fatal_warnings">,
807 HelpText<"Treat warnings as errors">,
809 def no_eh_labels : Flag<["-"], "no_eh_labels">,
810 HelpText<"In -r mode, suppress .eh labels in the __eh_frame section">,
813 def warn_compact_unwind : Flag<["-"], "warn_compact_unwind">,
814 HelpText<"Warn for each FDE that cannot compact into the __unwind_info section and must remain in the __eh_frame section">,
817 def warn_weak_exports : Flag<["-"], "warn_weak_exports">,
818 HelpText<"Warn if the linked image contains weak external symbols">,
821 def no_weak_exports : Flag<["-"], "no_weak_exports">,
822 HelpText<"Fail if the linked image contains weak external symbols">,
825 def objc_gc_compaction : Flag<["-"], "objc_gc_compaction">,
826 HelpText<"Mark the Objective-C image as compatible with compacting garbage collection">,
829 def objc_gc : Flag<["-"], "objc_gc">,
830 HelpText<"Verify that all code was compiled with -fobjc-gc or -fobjc-gc-only">,
833 def objc_gc_only : Flag<["-"], "objc_gc_only">,
834 HelpText<"Verify that all code was compiled with -fobjc-gc-only">,
837 def dead_strip_dylibs : Flag<["-"], "dead_strip_dylibs">,
838 HelpText<"Remove dylibs that are unreachable by the entry point or exported symbols">,
840 def allow_sub_type_mismatches : Flag<["-"], "allow_sub_type_mismatches">,
841 HelpText<"Permit mixing objects compiled for different ARM CPU subtypes">,
844 def no_uuid : Flag<["-"], "no_uuid">,
845 HelpText<"Do not generate the LC_UUID load command">,
847 def root_safe : Flag<["-"], "root_safe">,
848 HelpText<"Set the MH_ROOT_SAFE bit in the mach-o header">,
851 def setuid_safe : Flag<["-"], "setuid_safe">,
852 HelpText<"Set the MH_SETUID_SAFE bit in the mach-o header">,
855 def interposable : Flag<["-"], "interposable">,
856 HelpText<"Indirects access to all to exported symbols in a dylib">,
859 def multi_module : Flag<["-"], "multi_module">,
861 HelpText<"Alias for -interposable">,
864 def init : Separate<["-"], "init">,
865 MetaVarName<"<symbol>">,
866 HelpText<"Run <symbol> as the first initializer in a dylib">,
869 def sub_library : Separate<["-"], "sub_library">,
870 MetaVarName<"<name>">,
871 HelpText<"Re-export the dylib as <name>">,
873 def sub_umbrella : Separate<["-"], "sub_umbrella">,
874 MetaVarName<"<name>">,
875 HelpText<"Re-export the framework as <name>">,
877 def allowable_client : Separate<["-"], "allowable_client">,
878 MetaVarName<"<name>">,
879 HelpText<"Specify <name> of a dylib or framework that is allowed to link to this dylib">,
882 def client_name : Separate<["-"], "client_name">,
883 MetaVarName<"<name>">,
884 HelpText<"Specifies a <name> this client should match with the -allowable_client <name> in an explicitly linked dylib">,
886 def umbrella : Separate<["-"], "umbrella">,
887 MetaVarName<"<name>">,
888 HelpText<"Re-export this dylib through the umbrella framework <name>">,
890 def headerpad : Separate<["-"], "headerpad">,
891 MetaVarName<"<size>">,
892 HelpText<"Allocate hex <size> extra space for future expansion of the load commands via install_name_tool (default is 0x20)">,
894 def headerpad_max_install_names : Flag<["-"], "headerpad_max_install_names">,
895 HelpText<"Allocate extra space so all load-command paths can expand to MAXPATHLEN via install_name_tool">,
897 def bind_at_load : Flag<["-"], "bind_at_load">,
898 HelpText<"Tell dyld to bind all symbols at load time, rather than lazily">,
901 def force_flat_namespace : Flag<["-"], "force_flat_namespace">,
902 HelpText<"Tell dyld to use a flat namespace on this executable and all its dependent dylibs & bundles">,
905 def segalign : Separate<["-"], "segalign">,
906 MetaVarName<"<boundary>">,
907 HelpText<"Align all segments to hex power-of-2 <boundary>">,
910 def sectalign : MultiArg<["-"], "sectalign", 3>,
911 MetaVarName<"<segment> <section> <boundary>">,
912 HelpText<"Align <section> within <segment> to hex power-of-2 <boundary>">,
914 def stack_addr : Separate<["-"], "stack_addr">,
915 MetaVarName<"<address>">,
916 HelpText<"Initialize stack pointer to hex <address> rounded to a page boundary">,
919 def segprot : MultiArg<["-"], "segprot", 3>,
920 MetaVarName<"<segment> <max> <init>">,
921 HelpText<"Specifies the <max> and <init> virtual memory protection of <segment> as r/w/x/-seg_addr_table path">,
923 def segs_read_write_addr : Separate<["-"], "segs_read_write_addr">,
924 MetaVarName<"<address>">,
925 HelpText<"This option is obsolete">,
928 def segs_read_only_addr : Separate<["-"], "segs_read_only_addr">,
929 MetaVarName<"<address>">,
930 HelpText<"This option is obsolete">,
933 def segaddr : MultiArg<["-"], "segaddr", 2>,
934 MetaVarName<"<segment> <address>">,
935 HelpText<"Specify the starting hex <address> at a 4KiB page boundary for <segment>">,
938 def seg_page_size : MultiArg<["-"], "seg_page_size", 2>,
939 MetaVarName<"<segment> <size>">,
940 HelpText<"Specifies the page <size> for <segment>. Segment size will be a multiple of its page size">,
943 def dylib_file : Separate<["-"], "dylib_file">,
944 MetaVarName<"<install_path:current_path>">,
945 HelpText<"Specify <current_path> as different from where a dylib normally resides at <install_path>">,
948 def weak_reference_mismatches : Separate<["-"], "weak_reference_mismatches">,
949 MetaVarName<"<treatment>">,
950 HelpText<"Resolve symbol imports of conflicting weakness according to <treatment> as weak, non-weak, or error (default is non-weak)">,
953 def read_only_relocs : Separate<["-"], "read_only_relocs">,
954 MetaVarName<"<treatment>">,
955 HelpText<"Handle relocations that modify read-only pages according to <treatment> of warning, error, or suppress (i.e., allow)">,
958 def force_cpusubtype_ALL : Flag<["-"], "force_cpusubtype_ALL">,
959 HelpText<"Mark binary as runnable on any PowerPC, ignoring any PowerPC cpu requirements encoded in the object files">,
962 def no_arch_warnings : Flag<["-"], "no_arch_warnings">,
963 HelpText<"Suppresses warnings about inputs whose architecture does not match the -arch option">,
966 def arch_errors_fatal : Flag<["-"], "arch_errors_fatal">,
967 HelpText<"Escalate to errors any warnings about inputs whose architecture does not match the -arch option">,
969 def e : Separate<["-"], "e">,
970 MetaVarName<"<symbol>">,
971 HelpText<"Make <symbol> the entry point of an executable (default is \"start\" from crt1.o)">,
973 def w : Flag<["-"], "w">,
974 HelpText<"Suppress all warnings">,
976 def final_output : Separate<["-"], "final_output">,
977 MetaVarName<"<name>">,
978 HelpText<"Specify dylib install name if -install_name is not used; used by compiler driver for multiple -arch arguments">,
980 def arch_multiple : Flag<["-"], "arch_multiple">,
981 HelpText<"Augment error and warning messages with the architecture name">,
983 def dot : Separate<["-"], "dot">,
984 MetaVarName<"<path>">,
985 HelpText<"Write a graph of symbol dependencies to <path> as a .dot file viewable with GraphViz">,
988 def keep_relocs : Flag<["-"], "keep_relocs">,
989 HelpText<"Retain section-based relocation records in the output, which are ignored at runtime by dyld">,
992 def warn_stabs : Flag<["-"], "warn_stabs">,
993 HelpText<"Warn when bad stab symbols inside a BINCL/EINCL prevent optimization">,
996 def warn_commons : Flag<["-"], "warn_commons">,
997 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">,
1000 def read_only_stubs : Flag<["-"], "read_only_stubs">,
1001 HelpText<"On i386, make the __IMPORT segment of a final linked image read-only">,
1002 Flags<[HelpHidden]>,
1004 def interposable_list : Separate<["-"], "interposable_list">,
1005 MetaVarName<"<path>">,
1006 HelpText<"Access global symbols listed in <path> indirectly">,
1007 Flags<[HelpHidden]>,
1009 def no_function_starts : Flag<["-"], "no_function_starts">,
1010 HelpText<"Do not create table of function start addresses">,
1012 def object_path_lto : Separate<["-"], "object_path_lto">,
1013 MetaVarName<"<path>">,
1014 HelpText<"Retain any temporary mach-o file in <path> that would otherwise be deleted during LTO">,
1016 def cache_path_lto : Separate<["-"], "cache_path_lto">,
1017 MetaVarName<"<path>">,
1018 HelpText<"Use <path> as a directory for the incremental LTO cache">,
1020 def prune_interval_lto : Separate<["-"], "prune_interval_lto">,
1021 MetaVarName<"<seconds>">,
1022 HelpText<"Prune the incremental LTO cache after <seconds> (-1 disables pruning)">,
1024 def prune_after_lto : Separate<["-"], "prune_after_lto">,
1025 MetaVarName<"<seconds>">,
1026 HelpText<"Remove LTO cache entries after <seconds>">,
1028 def max_relative_cache_size_lto : Separate<["-"], "max_relative_cache_size_lto">,
1029 MetaVarName<"<percent>">,
1030 HelpText<"Limit the incremental LTO cache growth to <percent> of free disk, space">,
1032 def page_align_data_atoms : Flag<["-"], "page_align_data_atoms">,
1033 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">,
1034 Flags<[HelpHidden]>,
1036 def not_for_dyld_shared_cache : Flag<["-"], "not_for_dyld_shared_cache">,
1037 HelpText<"Prevent system dylibs from being placed into the dylib shared cache">,
1038 Flags<[HelpHidden]>,
1040 def mllvm : Separate<["-"], "mllvm">,
1041 HelpText<"Options to pass to LLVM">,
1043 def mcpu : Separate<["-"], "mcpu">,
1044 HelpText<"Processor family target for LTO code generation">,
1046 def no_dtrace_dof : Flag<["-"], "no_dtrace_dof">,
1047 HelpText<"Disable dtrace-dof processing (default).">,
1049 def objc_stubs_fast : Flag<["-"], "objc_stubs_fast">,
1050 HelpText<"Produce larger stubs for Objective-C method calls with fewer jumps (default).">,
1052 def objc_stubs_small : Flag<["-"], "objc_stubs_small">,
1053 HelpText<"Produce smaller stubs for Objective-C method calls with more jumps.">,
1055 def dyld_env : Separate<["-"], "dyld_env">,
1056 MetaVarName<"<dyld_env_var>">,
1057 HelpText<"Specifies a LC_DYLD_ENVIRONMENT variable value pair.">,
1059 def ignore_auto_link : Flag<["-"], "ignore_auto_link">,
1060 HelpText<"Ignore LC_LINKER_OPTIONs">,
1063 def grp_deprecated : OptionGroup<"deprecated">, HelpText<"DEPRECATED">;
1065 def lazy_framework : Separate<["-"], "lazy_framework">,
1066 MetaVarName<"<name>">,
1067 HelpText<"This option is deprecated and is now an alias for -framework.">,
1068 Flags<[HelpHidden]>,
1069 Group<grp_deprecated>;
1070 def lazy_library : Separate<["-"], "lazy_library">,
1071 MetaVarName<"<path>">,
1072 HelpText<"This option is deprecated and is now an alias for regular linking">,
1073 Flags<[HelpHidden]>,
1074 Group<grp_deprecated>;
1075 def lazy_l : Joined<["-"], "lazy-l">,
1076 MetaVarName<"<name>">,
1077 HelpText<"This option is deprecated and is now an alias for -l<path>.">,
1078 Flags<[HelpHidden]>,
1079 Group<grp_deprecated>;
1080 def single_module : Flag<["-"], "single_module">,
1081 HelpText<"Unnecessary option: this is already the default">,
1082 Flags<[HelpHidden]>,
1083 Group<grp_deprecated>;
1084 def no_dead_strip_inits_and_terms : Flag<["-"], "no_dead_strip_inits_and_terms">,
1085 HelpText<"Unnecessary option: initialization and termination are roots of the dead strip graph, so never dead stripped">,
1086 Flags<[HelpHidden]>,
1087 Group<grp_deprecated>;
1089 def grp_obsolete : OptionGroup<"obsolete">, HelpText<"OBSOLETE">;
1091 def sectorder : MultiArg<["-"], "sectorder", 3>,
1092 MetaVarName<"<segname> <sectname> <orderfile>">,
1093 HelpText<"Obsolete. Replaced by more general -order_file option">,
1094 Group<grp_obsolete>;
1095 def lto_library : Separate<["-"], "lto_library">,
1096 MetaVarName<"<path>">,
1097 HelpText<"Obsolete. LLD supports LTO directly, without using an external dylib.">,
1098 Group<grp_obsolete>;
1099 def y : Joined<["-"], "y">,
1100 MetaVarName<"<symbol>">,
1101 HelpText<"This option is obsolete in ld64">,
1102 Flags<[HelpHidden]>,
1103 Group<grp_obsolete>;
1104 def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>,
1105 MetaVarName<"<segname> <sectname>">,
1106 HelpText<"This option is obsolete in ld64">,
1107 Flags<[HelpHidden]>,
1108 Group<grp_obsolete>;
1109 def nofixprebinding : Flag<["-"], "nofixprebinding">,
1110 HelpText<"This option is obsolete in ld64">,
1111 Flags<[HelpHidden]>,
1112 Group<grp_obsolete>;
1113 def noprebind_all_twolevel_modules : Flag<["-"], "noprebind_all_twolevel_modules">,
1114 HelpText<"This option is obsolete in ld64">,
1115 Flags<[HelpHidden]>,
1116 Group<grp_obsolete>;
1117 def prebind_all_twolevel_modules : Flag<["-"], "prebind_all_twolevel_modules">,
1118 HelpText<"This option is obsolete in ld64">,
1119 Flags<[HelpHidden]>,
1120 Group<grp_obsolete>;
1121 def prebind_allow_overlap : Flag<["-"], "prebind_allow_overlap">,
1122 HelpText<"This option is obsolete in ld64">,
1123 Flags<[HelpHidden]>,
1124 Group<grp_obsolete>;
1125 def noprebind : Flag<["-"], "noprebind">,
1126 HelpText<"This option is obsolete in ld64">,
1127 Flags<[HelpHidden]>,
1128 Group<grp_obsolete>;
1129 def sect_diff_relocs : Separate<["-"], "sect_diff_relocs">,
1130 MetaVarName<"<treatment>">,
1131 HelpText<"This option is obsolete in ld64">,
1132 Flags<[HelpHidden]>,
1133 Group<grp_obsolete>;
1134 def A : Separate<["-"], "A">,
1135 MetaVarName<"<basefile>">,
1136 HelpText<"This option is obsolete in ld64">,
1137 Flags<[HelpHidden]>,
1138 Group<grp_obsolete>;
1139 def b : Flag<["-"], "b">,
1140 HelpText<"This option is obsolete in ld64">,
1141 Flags<[HelpHidden]>,
1142 Group<grp_obsolete>;
1143 def Sn : Flag<["-"], "Sn">,
1144 HelpText<"This option is obsolete in ld64">,
1145 Flags<[HelpHidden]>,
1146 Group<grp_obsolete>;
1147 def Si : Flag<["-"], "Si">,
1148 HelpText<"This option is obsolete in ld64">,
1149 Flags<[HelpHidden]>,
1150 Group<grp_obsolete>;
1151 def Sp : Flag<["-"], "Sp">,
1152 HelpText<"This option is obsolete in ld64">,
1153 Flags<[HelpHidden]>,
1154 Group<grp_obsolete>;
1155 def X : Flag<["-"], "X">,
1156 HelpText<"This option is obsolete in ld64">,
1157 Flags<[HelpHidden]>,
1158 Group<grp_obsolete>;
1159 def s : Flag<["-"], "s">,
1160 HelpText<"This option is obsolete in ld64">,
1161 Flags<[HelpHidden]>,
1162 Group<grp_obsolete>;
1163 def m : Flag<["-"], "m">,
1164 HelpText<"This option is obsolete in ld64">,
1165 Flags<[HelpHidden]>,
1166 Group<grp_obsolete>;
1167 def Y : Separate<["-"], "Y">,
1168 MetaVarName<"<number>">,
1169 HelpText<"This option is obsolete in ld64">,
1170 Flags<[HelpHidden]>,
1171 Group<grp_obsolete>;
1172 def nomultidefs : Flag<["-"], "nomultidefs">,
1173 HelpText<"This option is obsolete in ld64">,
1174 Flags<[HelpHidden]>,
1175 Group<grp_obsolete>;
1176 def multiply_defined_unused : Separate<["-"], "multiply_defined_unused">,
1177 MetaVarName<"<treatment>">,
1178 HelpText<"This option is obsolete in ld64">,
1179 Flags<[HelpHidden]>,
1180 Group<grp_obsolete>;
1181 def multiply_defined : Separate<["-"], "multiply_defined">,
1182 MetaVarName<"<treatment>">,
1183 HelpText<"This option is obsolete in ld64">,
1184 Flags<[HelpHidden]>,
1185 Group<grp_obsolete>;
1186 def private_bundle : Flag<["-"], "private_bundle">,
1187 HelpText<"This option is obsolete in ld64">,
1188 Flags<[HelpHidden]>,
1189 Group<grp_obsolete>;
1190 def seg_addr_table_filename : Separate<["-"], "seg_addr_table_filename">,
1191 MetaVarName<"<path>">,
1192 HelpText<"This option is obsolete in ld64">,
1193 Flags<[HelpHidden]>,
1194 Group<grp_obsolete>;
1195 def sectorder_detail : Flag<["-"], "sectorder_detail">,
1196 HelpText<"This option is obsolete in ld64">,
1197 Flags<[HelpHidden]>,
1198 Group<grp_obsolete>;
1199 def no_compact_linkedit : Flag<["-"], "no_compact_linkedit">,
1200 HelpText<"This option is obsolete in ld64">,
1201 Flags<[HelpHidden]>,
1202 Group<grp_obsolete>;
1203 def dependent_dr_info : Flag<["-"], "dependent_dr_info">,
1204 HelpText<"This option is obsolete in ld64">,
1205 Flags<[HelpHidden]>,
1206 Group<grp_obsolete>;
1207 def no_dependent_dr_info : Flag<["-"], "no_dependent_dr_info">,
1208 HelpText<"This option is obsolete in ld64">,
1209 Flags<[HelpHidden]>,
1210 Group<grp_obsolete>;
1211 def seglinkedit : Flag<["-"], "seglinkedit">,
1212 HelpText<"This option is obsolete in ld64">,
1213 Flags<[HelpHidden]>,
1214 Group<grp_obsolete>;
1215 def noseglinkedit : Flag<["-"], "noseglinkedit">,
1216 HelpText<"This option is obsolete in ld64">,
1217 Flags<[HelpHidden]>,
1218 Group<grp_obsolete>;
1219 def fvmlib : Flag<["-"], "fvmlib">,
1220 HelpText<"This option is obsolete in ld64">,
1221 Flags<[HelpHidden]>,
1222 Group<grp_obsolete>;
1223 def run_init_lazily : Flag<["-"], "run_init_lazily">,
1224 HelpText<"This option is obsolete in ld64">,
1225 Flags<[HelpHidden]>,
1226 Group<grp_obsolete>;
1227 def prebind : Flag<["-"], "prebind">,
1228 HelpText<"This option is obsolete in ld64">,
1229 Flags<[HelpHidden]>,
1230 Group<grp_obsolete>;
1231 def twolevel_namespace_hints : Flag<["-"], "twolevel_namespace_hints">,
1232 HelpText<"This option is obsolete in ld64">,
1233 Flags<[HelpHidden]>,
1234 Group<grp_obsolete>;
1235 def slow_stubs : Flag<["-"], "slow_stubs">,
1236 HelpText<"This option is obsolete in ld64">,
1237 Flags<[HelpHidden]>,
1238 Group<grp_obsolete>;
1240 def bitcode_bundle : Flag<["-"], "bitcode_bundle">,
1241 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1242 Flags<[HelpHidden]>,
1243 Group<grp_obsolete>;
1244 def bitcode_hide_symbols : Flag<["-"], "bitcode_hide_symbols">,
1245 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1246 Flags<[HelpHidden]>,
1247 Group<grp_obsolete>;
1248 def bitcode_symbol_map : Separate<["-"], "bitcode_symbol_map">,
1249 MetaVarName<"<path>">,
1250 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1251 Flags<[HelpHidden]>,
1252 Group<grp_obsolete>;
1253 def bitcode_process_mode : Separate<["-"], "bitcode_process_mode">,
1254 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1255 Flags<[HelpHidden]>,
1256 Group<grp_obsolete>;
1257 def bitcode_verify : Flag<["-"], "bitcode_verify">,
1258 HelpText<"Obsolete since the App Store no longer supports binaries with embedded bitcode">,
1259 Flags<[HelpHidden]>,
1260 Group<grp_obsolete>;
1262 def grp_undocumented : OptionGroup<"undocumented">, HelpText<"UNDOCUMENTED">;
1264 def add_linker_option : Flag<["-"], "add_linker_option">,
1265 HelpText<"This option is undocumented in ld64">,
1266 Flags<[HelpHidden]>,
1267 Group<grp_undocumented>;
1268 def add_source_version : Flag<["-"], "add_source_version">,
1269 HelpText<"This option is undocumented in ld64">,
1270 Flags<[HelpHidden]>,
1271 Group<grp_undocumented>;
1272 def no_source_version : Flag<["-"], "no_source_version">,
1273 HelpText<"This option is undocumented in ld64">,
1274 Flags<[HelpHidden]>,
1275 Group<grp_undocumented>;
1276 def add_split_seg_info : Flag<["-"], "add_split_seg_info">,
1277 HelpText<"This option is undocumented in ld64">,
1278 Flags<[HelpHidden]>,
1279 Group<grp_undocumented>;
1280 def allow_dead_duplicates : Flag<["-"], "allow_dead_duplicates">,
1281 HelpText<"This option is undocumented in ld64">,
1282 Flags<[HelpHidden]>,
1283 Group<grp_undocumented>;
1284 def allow_simulator_linking_to_macosx_dylibs : Flag<["-"], "allow_simulator_linking_to_macosx_dylibs">,
1285 HelpText<"This option is undocumented in ld64">,
1286 Flags<[HelpHidden]>,
1287 Group<grp_undocumented>;
1288 def classic_linker : Flag<["-"], "classic_linker">,
1289 HelpText<"This option is undocumented in ld64">,
1290 Flags<[HelpHidden]>,
1291 Group<grp_undocumented>;
1292 def data_in_code_info : Flag<["-"], "data_in_code_info">,
1293 HelpText<"Emit data-in-code information (default)">,
1294 Group<grp_undocumented>;
1295 def no_data_in_code_info : Flag<["-"], "no_data_in_code_info">,
1296 HelpText<"Do not emit data-in-code information">,
1297 Group<grp_undocumented>;
1298 def debug_snapshot : Flag<["-"], "debug_snapshot">,
1299 HelpText<"This option is undocumented in ld64">,
1300 Flags<[HelpHidden]>,
1301 Group<grp_undocumented>;
1302 def demangle : Flag<["-"], "demangle">,
1303 HelpText<"Demangle symbol names in diagnostics">;
1304 def encryptable : Flag<["-"], "encryptable">,
1305 HelpText<"Generate the LC_ENCRYPTION_INFO load command">,
1306 Group<grp_undocumented>;
1307 def no_encryption : Flag<["-"], "no_encryption">,
1308 HelpText<"Do not generate the LC_ENCRYPTION_INFO load command">,
1309 Group<grp_undocumented>;
1310 def executable_path : Flag<["-"], "executable_path">,
1311 HelpText<"This option is undocumented in ld64">,
1312 Flags<[HelpHidden]>,
1313 Group<grp_undocumented>;
1314 def fixup_chains : Flag<["-"], "fixup_chains">,
1315 HelpText<"Emit chained fixups">,
1316 Group<grp_undocumented>;
1317 def no_fixup_chains : Flag<["-"], "no_fixup_chains">,
1318 HelpText<"Emit fixup information as classic dyld opcodes">,
1319 Group<grp_undocumented>;
1320 def fixup_chains_section : Flag<["-"], "fixup_chains_section">,
1321 HelpText<"This option is undocumented in ld64">,
1322 Flags<[HelpHidden]>,
1323 Group<grp_undocumented>;
1324 def objc_relative_method_lists : Flag<["-"], "objc_relative_method_lists">,
1325 HelpText<"Emit relative method lists (more compact representation)">,
1326 Group<grp_undocumented>;
1327 def no_objc_relative_method_lists : Flag<["-"], "no_objc_relative_method_lists">,
1328 HelpText<"Don't emit relative method lists (use traditional representation)">,
1329 Group<grp_undocumented>;
1330 def flto_codegen_only : Flag<["-"], "flto-codegen-only">,
1331 HelpText<"This option is undocumented in ld64">,
1332 Flags<[HelpHidden]>,
1333 Group<grp_undocumented>;
1334 def force_symbol_not_weak : Flag<["-"], "force_symbol_not_weak">,
1335 HelpText<"This option is undocumented in ld64">,
1336 Flags<[HelpHidden]>,
1337 Group<grp_undocumented>;
1338 def force_symbols_coalesce_list : Flag<["-"], "force_symbols_coalesce_list">,
1339 HelpText<"This option is undocumented in ld64">,
1340 Flags<[HelpHidden]>,
1341 Group<grp_undocumented>;
1342 def force_symbols_not_weak_list : Separate<["-"], "force_symbols_not_weak_list">,
1343 HelpText<"This option is undocumented in ld64">,
1344 Flags<[HelpHidden]>,
1345 Group<grp_undocumented>;
1346 def force_symbols_weak_list : Separate<["-"], "force_symbols_weak_list">,
1347 HelpText<"This option is undocumented in ld64">,
1348 Flags<[HelpHidden]>,
1349 Group<grp_undocumented>;
1350 def force_symbol_weak : Flag<["-"], "force_symbol_weak">,
1351 HelpText<"This option is undocumented in ld64">,
1352 Flags<[HelpHidden]>,
1353 Group<grp_undocumented>;
1354 def function_starts : Flag<["-"], "function_starts">,
1355 HelpText<"Create table of function start addresses (default)">,
1356 Group<grp_undocumented>;
1357 def i : Flag<["-"], "i">,
1358 HelpText<"This option is undocumented in ld64">,
1359 Flags<[HelpHidden]>,
1360 Group<grp_undocumented>;
1361 def ignore_optimization_hints : Flag<["-"], "ignore_optimization_hints">,
1362 HelpText<"Ignore Linker Optimization Hints">,
1363 Group<grp_undocumented>;
1364 def init_offsets : Flag<["-"], "init_offsets">,
1365 HelpText<"Store __TEXT segment offsets of static initializers">,
1366 Group<grp_undocumented>;
1367 def keep_dwarf_unwind : Flag<["-"], "keep_dwarf_unwind">,
1368 HelpText<"This option is undocumented in ld64">,
1369 Flags<[HelpHidden]>,
1370 Group<grp_undocumented>;
1371 def no_keep_dwarf_unwind : Flag<["-"], "no_keep_dwarf_unwind">,
1372 HelpText<"This option is undocumented in ld64">,
1373 Flags<[HelpHidden]>,
1374 Group<grp_undocumented>;
1375 def kext : Flag<["-"], "kext">,
1376 HelpText<"This option is undocumented in ld64">,
1377 Flags<[HelpHidden]>,
1378 Group<grp_undocumented>;
1379 def kext_objects_dir : Flag<["-"], "kext_objects_dir">,
1380 HelpText<"This option is undocumented in ld64">,
1381 Flags<[HelpHidden]>,
1382 Group<grp_undocumented>;
1383 def no_kext_objects : Flag<["-"], "no_kext_objects">,
1384 HelpText<"This option is undocumented in ld64">,
1385 Flags<[HelpHidden]>,
1386 Group<grp_undocumented>;
1387 def kexts_use_stubs : Flag<["-"], "kexts_use_stubs">,
1388 HelpText<"This option is undocumented in ld64">,
1389 Flags<[HelpHidden]>,
1390 Group<grp_undocumented>;
1391 def no_compact_unwind : Flag<["-"], "no_compact_unwind">,
1392 HelpText<"This option is undocumented in ld64">,
1393 Flags<[HelpHidden]>,
1394 Group<grp_undocumented>;
1395 def no_new_main : Flag<["-"], "no_new_main">,
1396 HelpText<"This option is undocumented in ld64">,
1397 Flags<[HelpHidden]>,
1398 Group<grp_undocumented>;
1399 def pause : Flag<["-"], "pause">,
1400 HelpText<"This option is undocumented in ld64">,
1401 Flags<[HelpHidden]>,
1402 Group<grp_undocumented>;
1403 def random_uuid : Flag<["-"], "random_uuid">,
1404 HelpText<"This option is undocumented in ld64">,
1405 Flags<[HelpHidden]>,
1406 Group<grp_undocumented>;
1407 def simulator_support : Flag<["-"], "simulator_support">,
1408 HelpText<"This option is undocumented in ld64">,
1409 Flags<[HelpHidden]>,
1410 Group<grp_undocumented>;
1411 def snapshot_dir : Flag<["-"], "snapshot_dir">,
1412 HelpText<"This option is undocumented in ld64">,
1413 Flags<[HelpHidden]>,
1414 Group<grp_undocumented>;
1415 def source_version : Flag<["-"], "source_version">,
1416 HelpText<"This option is undocumented in ld64">,
1417 Flags<[HelpHidden]>,
1418 Group<grp_undocumented>;
1419 def threaded_starts_section : Flag<["-"], "threaded_starts_section">,
1420 HelpText<"This option is undocumented in ld64">,
1421 Flags<[HelpHidden]>,
1422 Group<grp_undocumented>;
1423 def verbose_optimization_hints : Flag<["-"], "verbose_optimization_hints">,
1424 HelpText<"This option is undocumented in ld64">,
1425 Flags<[HelpHidden]>,
1426 Group<grp_undocumented>;
1427 def version_load_command : Flag<["-"], "version_load_command">,
1428 HelpText<"This option is undocumented in ld64">,
1429 Flags<[HelpHidden]>,
1430 Group<grp_undocumented>;
1432 def grp_ignored : OptionGroup<"ignored">, HelpText<"IGNORED">;
1434 def M : Flag<["-"], "M">,
1435 HelpText<"This option is ignored in ld64">,
1436 Flags<[HelpHidden]>,
1438 def new_linker : Flag<["-"], "new_linker">,
1439 HelpText<"This option is ignored in ld64">,
1440 Flags<[HelpHidden]>,
1443 def grp_ignored_silently : OptionGroup<"ignored_silently">, HelpText<"IGNORED SILENTLY">;
1445 def objc_abi_version : Separate<["-"], "objc_abi_version">,
1446 HelpText<"This option only applies to i386 in ld64">,
1447 Flags<[HelpHidden]>,
1448 Group<grp_ignored_silently>;
1449 def debug_variant : Flag<["-"], "debug_variant">,
1450 HelpText<"Do not warn about issues that are only problems for binaries shipping to customers.">,
1451 Flags<[HelpHidden]>,
1452 Group<grp_ignored_silently>;
1454 // NOTE: This flag should be respected if -warn_duplicate_libraries is ever implemented.
1455 def no_warn_duplicate_libraries : Flag<["-"], "no_warn_duplicate_libraries">,
1456 HelpText<"Do not warn if the input contains duplicate library options.">,
1457 Flags<[HelpHidden]>,
1458 Group<grp_ignored_silently>;