xref: /freebsd/contrib/llvm-project/lld/MachO/Options.td (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
1include "llvm/Option/OptParser.td"
2
3// Flags that lld/MachO understands but ld64 doesn't. These take
4// '--' instead of '-' and use dashes instead of underscores, so
5// they don't collide with the ld64 compat options.
6def grp_lld : OptionGroup<"kind">, HelpText<"LLD-SPECIFIC">;
7
8def help : Flag<["-", "--"], "help">,
9    Group<grp_lld>;
10def help_hidden : Flag<["--"], "help-hidden">,
11    HelpText<"Display help for hidden options">,
12    Group<grp_lld>;
13def verbose : Flag<["--"], "verbose">,
14    Group<grp_lld>;
15def error_limit_eq : Joined<["--"], "error-limit=">,
16    HelpText<"Maximum number of errors to print before exiting (default: 20)">,
17    Group<grp_lld>;
18def color_diagnostics: Flag<["--"], "color-diagnostics">,
19    HelpText<"Alias for --color-diagnostics=always">,
20    Group<grp_lld>;
21def no_color_diagnostics: Flag<["--"], "no-color-diagnostics">,
22    HelpText<"Alias for --color-diagnostics=never">,
23    Group<grp_lld>;
24def color_diagnostics_eq: Joined<["--"], "color-diagnostics=">,
25    HelpText<"Use colors in diagnostics (default: auto)">,
26    MetaVarName<"[auto,always,never]">,
27    Group<grp_lld>;
28def threads_eq : Joined<["--"], "threads=">,
29    HelpText<"Number of threads. '1' disables multi-threading. By default all available hardware threads are used">,
30    Group<grp_lld>;
31def thinlto_jobs_eq : Joined<["--"], "thinlto-jobs=">,
32    HelpText<"Number of ThinLTO jobs. Default to --threads=">,
33    Group<grp_lld>;
34def reproduce: Separate<["--"], "reproduce">,
35    Group<grp_lld>;
36def reproduce_eq: Joined<["--"], "reproduce=">,
37    Alias<!cast<Separate>(reproduce)>,
38    HelpText<"Write tar file containing inputs and command to reproduce link">,
39    Group<grp_lld>;
40def version: Flag<["--"], "version">,
41    HelpText<"Display the version number and exit">,
42    Group<grp_lld>;
43def lto_legacy_pass_manager: Flag<["--"], "lto-legacy-pass-manager">,
44    HelpText<"Use the legacy pass manager in LLVM">,
45    Group<grp_lld>;
46def no_lto_legacy_pass_manager : Flag<["--"], "no-lto-legacy-pass-manager">,
47    HelpText<"Use the new pass manager in LLVM">,
48    Group<grp_lld>;
49def time_trace: Flag<["--"], "time-trace">, HelpText<"Record time trace">,
50    Group<grp_lld>;
51def time_trace_granularity_eq: Joined<["--"], "time-trace-granularity=">,
52    HelpText<"Minimum time granularity (in microseconds) traced by time profiler">,
53    Group<grp_lld>;
54def time_trace_file_eq: Joined<["--"], "time-trace-file=">,
55    HelpText<"Specify time trace output file">,
56    Group<grp_lld>;
57def deduplicate_literals: Flag<["--"], "deduplicate-literals">,
58    HelpText<"Enable literal deduplication. This is implied by --icf={safe,all}">,
59    Group<grp_lld>;
60def print_dylib_search: Flag<["--"], "print-dylib-search">,
61    HelpText<"Print which paths lld searched when trying to find dylibs">,
62    Group<grp_lld>;
63def icf_eq: Joined<["--"], "icf=">,
64    HelpText<"Set level for identical code folding (default: none)">,
65    MetaVarName<"[none,safe,all]">,
66    Group<grp_lld>;
67def lto_O: Joined<["--"], "lto-O">,
68    HelpText<"Set optimization level for LTO (default: 2)">,
69    MetaVarName<"<opt-level>">,
70    Group<grp_lld>;
71def thinlto_cache_policy: Joined<["--"], "thinlto-cache-policy=">,
72    HelpText<"Pruning policy for the ThinLTO cache">,
73    Group<grp_lld>;
74def O : JoinedOrSeparate<["-"], "O">,
75    HelpText<"Optimize output file size">;
76
77// This is a complete Options.td compiled from Apple's ld(1) manpage
78// dated 2018-03-07 and cross checked with ld64 source code in repo
79// https://github.com/apple-opensource/ld64 at git tag "512.4" dated
80// 2018-03-18.
81
82// Flags<[HelpHidden]> marks options that are not yet ported to lld,
83// and serve as a scoreboard for annotating our progress toward
84// implementing ld64 options in lld. As you add implementions to
85// Driver.cpp, please remove the hidden flag here.
86
87def grp_kind : OptionGroup<"kind">, HelpText<"OUTPUT KIND">;
88
89def execute : Flag<["-"], "execute">,
90    HelpText<"Produce a main executable (default)">,
91    Group<grp_kind>;
92def dylib : Flag<["-"], "dylib">,
93    HelpText<"Produce a shared library">,
94    Group<grp_kind>;
95def bundle : Flag<["-"], "bundle">,
96    HelpText<"Produce a bundle">,
97    Group<grp_kind>;
98def r : Flag<["-"], "r">,
99    HelpText<"Merge multiple object files into one, retaining relocations">,
100    Flags<[HelpHidden]>,
101    Group<grp_kind>;
102def dylinker : Flag<["-"], "dylinker">,
103    HelpText<"Produce a dylinker only used when building dyld">,
104    Flags<[HelpHidden]>,
105    Group<grp_kind>;
106def dynamic : Flag<["-"], "dynamic">,
107    HelpText<"Link dynamically (default)">,
108    Group<grp_kind>;
109def static : Flag<["-"], "static">,
110    HelpText<"Link statically">,
111    Flags<[HelpHidden]>,
112    Group<grp_kind>;
113def preload : Flag<["-"], "preload">,
114    HelpText<"Produce an unsegmented binary for embedded systems">,
115    Flags<[HelpHidden]>,
116    Group<grp_kind>;
117def arch : Separate<["-"], "arch">,
118    MetaVarName<"<arch_name>">,
119    HelpText<"The architecture (e.g. ppc, ppc64, i386, x86_64)">,
120    Group<grp_kind>;
121def o : Separate<["-"], "o">,
122    MetaVarName<"<path>">,
123    HelpText<"The name of the output file (default: `a.out')">,
124    Group<grp_kind>;
125
126def grp_libs : OptionGroup<"libs">, HelpText<"LIBRARIES">;
127
128def l : Joined<["-"], "l">,
129    MetaVarName<"<name>">,
130    HelpText<"Search for lib<name>.dylib or lib<name>.a on the library search path">,
131    Group<grp_libs>;
132def weak_l : Joined<["-"], "weak-l">,
133    MetaVarName<"<name>">,
134    HelpText<"Like -l<name>, but mark library and its references as weak imports">,
135    Group<grp_libs>;
136def weak_library : Separate<["-"], "weak_library">,
137    MetaVarName<"<path>">,
138    HelpText<"Like bare <path>, but mark library and its references as weak imports">,
139    Group<grp_libs>;
140def needed_l : Joined<["-"], "needed-l">,
141    MetaVarName<"<name>">,
142    HelpText<"Like -l<name>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
143    Group<grp_libs>;
144def needed_library : Separate<["-"], "needed_library">,
145    MetaVarName<"<path>">,
146    HelpText<"Like bare <path>, but link library even if its symbols are not used and -dead_strip_dylibs is active">,
147    Group<grp_libs>;
148def reexport_l : Joined<["-"], "reexport-l">,
149    MetaVarName<"<name>">,
150    HelpText<"Like -l<name>, but export all symbols of <name> from newly created library">,
151    Group<grp_libs>;
152def reexport_library : Separate<["-"], "reexport_library">,
153    MetaVarName<"<path>">,
154    HelpText<"Like bare <path>, but export all symbols of <path> from newly created library">,
155    Group<grp_libs>;
156def upward_l : Joined<["-"], "upward-l">,
157    MetaVarName<"<name>">,
158    HelpText<"Like -l<name>, but specify dylib as an upward dependency">,
159    Flags<[HelpHidden]>,
160    Group<grp_libs>;
161def upward_library : Separate<["-"], "upward_library">,
162    MetaVarName<"<path>">,
163    HelpText<"Like bare <path>, but specify dylib as an upward dependency">,
164    Flags<[HelpHidden]>,
165    Group<grp_libs>;
166def L : JoinedOrSeparate<["-"], "L">,
167    MetaVarName<"<dir>">,
168    HelpText<"Add dir to the library search path">,
169    Group<grp_libs>;
170def Z : Flag<["-"], "Z">,
171    HelpText<"Remove standard directories from the library and framework search paths">,
172    Group<grp_libs>;
173def syslibroot : Separate<["-"], "syslibroot">,
174    MetaVarName<"<rootdir>">,
175    HelpText<"Prepend <rootdir> to all library and framework search paths">,
176    Group<grp_libs>;
177def search_paths_first : Flag<["-"], "search_paths_first">,
178    HelpText<"Search for lib<name>.dylib and lib<name>.a at each step in traversing search path (default for Xcode 4 and later)">,
179    Group<grp_libs>;
180def search_dylibs_first : Flag<["-"], "search_dylibs_first">,
181    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)">,
182    Group<grp_libs>;
183def framework : Separate<["-"], "framework">,
184    MetaVarName<"<name>">,
185    HelpText<"Search for <name>.framework/<name> on the framework search path">,
186    Group<grp_libs>;
187def weak_framework : Separate<["-"], "weak_framework">,
188    MetaVarName<"<name>">,
189    HelpText<"Like -framework <name>, but mark framework and its references as weak imports">,
190    Group<grp_libs>;
191def needed_framework : Separate<["-"], "needed_framework">,
192    MetaVarName<"<name>">,
193    HelpText<"Like -framework <name>, but link <name> even if none of its symbols are used and -dead_strip_dylibs is active">,
194    Group<grp_libs>;
195def reexport_framework : Separate<["-"], "reexport_framework">,
196    MetaVarName<"<name>">,
197    HelpText<"Like -framework <name>, but export all symbols of <name> from the newly created library">,
198    Group<grp_libs>;
199def upward_framework : Separate<["-"], "upward_framework">,
200    MetaVarName<"<name>">,
201    HelpText<"Like -framework <name>, but specify the framework as an upward dependency">,
202    Flags<[HelpHidden]>,
203    Group<grp_libs>;
204def F : JoinedOrSeparate<["-"], "F">,
205    MetaVarName<"<dir>">,
206    HelpText<"Add dir to the framework search path">,
207    Group<grp_libs>;
208def all_load : Flag<["-"], "all_load">,
209    HelpText<"Load all members of all static archive libraries">,
210    Group<grp_libs>;
211def ObjC : Flag<["-"], "ObjC">,
212    HelpText<"Load all members of static archives that are an Objective-C class or category.">,
213    Group<grp_libs>;
214def force_load : Separate<["-"], "force_load">,
215    MetaVarName<"<path>">,
216    HelpText<"Load all members static archive library at <path>">,
217    Group<grp_libs>;
218def force_load_swift_libs : Flag<["-"], "force_load_swift_libs">,
219    HelpText<"Apply -force_load to libraries listed in LC_LINKER_OPTIONS whose names start with 'swift'">,
220    Group<grp_libs>;
221
222def grp_content : OptionGroup<"content">, HelpText<"ADDITIONAL CONTENT">;
223
224def sectcreate : MultiArg<["-"], "sectcreate", 3>,
225    MetaVarName<"<segment> <section> <file>">,
226    HelpText<"Create <section> in <segment> from the contents of <file>">,
227    Group<grp_content>;
228def segcreate : MultiArg<["-"], "segcreate", 3>,
229    MetaVarName<"<segment> <section> <file>">,
230    Alias<sectcreate>,
231    HelpText<"Alias for -sectcreate">,
232    Group<grp_content>;
233def filelist : Separate<["-"], "filelist">,
234    MetaVarName<"<file>">,
235    HelpText<"Read names of files to link from <file>">,
236    Group<grp_content>;
237def dtrace : Separate<["-"], "dtrace">,
238    MetaVarName<"<script>">,
239    HelpText<"Enable DTrace static probes according to declarations in <script>">,
240    Flags<[HelpHidden]>,
241    Group<grp_content>;
242
243def grp_opts : OptionGroup<"opts">, HelpText<"OPTIMIZATIONS">;
244
245def dead_strip : Flag<["-"], "dead_strip">,
246    HelpText<"Remove unreachable functions and data">,
247    Group<grp_opts>;
248def order_file : Separate<["-"], "order_file">,
249    MetaVarName<"<file>">,
250    HelpText<"Layout functions and data according to specification in <file>">,
251    Group<grp_opts>;
252def no_order_inits : Flag<["-"], "no_order_inits">,
253    HelpText<"Disable default reordering of initializer and terminator functions">,
254    Flags<[HelpHidden]>,
255    Group<grp_opts>;
256def no_order_data : Flag<["-"], "no_order_data">,
257    HelpText<"Disable default reordering of global data accessed at launch time">,
258    Flags<[HelpHidden]>,
259    Group<grp_opts>;
260def image_base : Separate<["-"], "image_base">,
261    MetaVarName<"<address>">,
262    HelpText<"Preferred hex load address for a dylib or bundle.">,
263    Flags<[HelpHidden]>,
264    Group<grp_opts>;
265def seg1addr : Separate<["-"], "seg1addr">,
266    MetaVarName<"<address>">,
267    Alias<image_base>,
268    HelpText<"Alias for -image_base">,
269    Flags<[HelpHidden]>,
270    Group<grp_opts>;
271def no_implicit_dylibs : Flag<["-"], "no_implicit_dylibs">,
272    HelpText<"Do not optimize public dylib transitive symbol references">,
273    Group<grp_opts>;
274def exported_symbols_order : Separate<["-"], "exported_symbols_order">,
275    MetaVarName<"<file>">,
276    HelpText<"Specify frequently-used symbols in <file> to optimize symbol exports">,
277    Flags<[HelpHidden]>,
278    Group<grp_opts>;
279def no_zero_fill_sections : Flag<["-"], "no_zero_fill_sections">,
280    HelpText<"Explicitly store zeroed data in the final image">,
281    Flags<[HelpHidden]>,
282    Group<grp_opts>;
283def merge_zero_fill_sections : Flag<["-"], "merge_zero_fill_sections">,
284    HelpText<"Merge all zeroed data into the __zerofill section">,
285    Flags<[HelpHidden]>,
286    Group<grp_opts>;
287def no_branch_islands : Flag<["-"], "no_branch_islands">,
288    HelpText<"Disable infra for branches beyond the maximum branch distance.">,
289    Flags<[HelpHidden]>,
290    Group<grp_opts>;
291def no_deduplicate : Flag<["-"], "no_deduplicate">,
292    HelpText<"Disable code deduplicaiton (synonym for `--icf=none')">,
293    Group<grp_opts>;
294
295def grp_version : OptionGroup<"version">, HelpText<"VERSION TARGETING">;
296
297def platform_version : MultiArg<["-"], "platform_version", 3>,
298    MetaVarName<"<platform> <min_version> <sdk_version>">,
299    HelpText<"Platform (e.g., macos, ios, tvos, watchos, bridgeos, mac-catalyst, ios-sim, tvos-sim, watchos-sim, driverkit) and version numbers">,
300    Group<grp_version>;
301def sdk_version : Separate<["-"], "sdk_version">,
302    HelpText<"This option is undocumented in ld64">,
303    Flags<[HelpHidden]>,
304    Group<grp_version>;
305def macos_version_min : Separate<["-"], "macos_version_min">,
306    MetaVarName<"<version>">,
307    HelpText<"Oldest macOS version for which linked output is usable">,
308    Group<grp_version>;
309def macosx_version_min : Separate<["-"], "macosx_version_min">,
310    MetaVarName<"<version>">,
311    Alias<macos_version_min>,
312    HelpText<"Alias for -macos_version_min">,
313    Flags<[HelpHidden]>,
314    Group<grp_version>;
315def ios_version_min : Separate<["-"], "ios_version_min">,
316    MetaVarName<"<version>">,
317    HelpText<"Oldest iOS version for which linked output is usable">,
318    Flags<[HelpHidden]>,
319    Group<grp_version>;
320def ios_simulator_version_min : Separate<["-"], "ios_simulator_version_min">,
321    MetaVarName<"<version>">,
322    HelpText<"Oldest iOS simulator version for which linked output is usable">,
323    Flags<[HelpHidden]>,
324    Group<grp_version>;
325def iphoneos_version_min : Separate<["-"], "iphoneos_version_min">,
326    MetaVarName<"<version>">,
327    Alias<ios_version_min>,
328    HelpText<"Alias for -ios_version_min">,
329    Flags<[HelpHidden]>,
330    Group<grp_version>;
331def maccatalyst_version_min : Separate<["-"], "maccatalyst_version_min">,
332    MetaVarName<"<version>">,
333    HelpText<"Oldest MacCatalyst version for which linked output is usable">,
334    Flags<[HelpHidden]>,
335    Group<grp_version>;
336def iosmac_version_min : Separate<["-"], "iosmac_version_min">,
337    MetaVarName<"<version>">,
338    Alias<maccatalyst_version_min>,
339    HelpText<"Alias for -maccatalyst_version_min">,
340    Flags<[HelpHidden]>,
341    Group<grp_version>;
342def uikitformac_version_min : Separate<["-"], "uikitformac_version_min">,
343    MetaVarName<"<version>">,
344    Alias<maccatalyst_version_min>,
345    HelpText<"Alias for -maccatalyst_version_min">,
346    Flags<[HelpHidden]>,
347    Group<grp_version>;
348def tvos_version_min : Separate<["-"], "tvos_version_min">,
349    MetaVarName<"<version>">,
350    HelpText<"Oldest tvOS version for which linked output is usable">,
351    Flags<[HelpHidden]>,
352    Group<grp_version>;
353def watchos_version_min : Separate<["-"], "watchos_version_min">,
354    MetaVarName<"<version>">,
355    HelpText<"Oldest watchOS version for which linked output is usable">,
356    Flags<[HelpHidden]>,
357    Group<grp_version>;
358def bridgeos_version_min : Separate<["-"], "bridgeos_version_min">,
359    MetaVarName<"<version>">,
360    HelpText<"Oldest bridgeOS version for which linked output is usable">,
361    Flags<[HelpHidden]>,
362    Group<grp_version>;
363def driverkit_version_min : Separate<["-"], "driverkit_version_min">,
364    MetaVarName<"<version>">,
365    HelpText<"Oldest DriverKit version for which linked output is usable">,
366    Flags<[HelpHidden]>,
367    Group<grp_version>;
368
369def grp_dylib : OptionGroup<"dylib">, HelpText<"DYNAMIC LIBRARIES (DYLIB)">;
370
371def install_name : Separate<["-"], "install_name">,
372    MetaVarName<"<name>">,
373    HelpText<"Set an internal install path in a dylib">,
374    Group<grp_dylib>;
375def dylib_install_name : Separate<["-"], "dylib_install_name">,
376    MetaVarName<"<name>">,
377    Alias<install_name>,
378    HelpText<"Alias for -install_name">,
379    Group<grp_dylib>;
380def dylinker_install_name : Separate<["-"], "dylinker_install_name">,
381    MetaVarName<"<name>">,
382    Alias<install_name>,
383    HelpText<"Alias for -install_name">,
384    Group<grp_dylib>;
385def mark_dead_strippable_dylib : Flag<["-"], "mark_dead_strippable_dylib">,
386    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">,
387    Group<grp_dylib>;
388def compatibility_version : Separate<["-"], "compatibility_version">,
389    MetaVarName<"<version>">,
390    HelpText<"Compatibility <version> of this library">,
391    Group<grp_dylib>;
392def dylib_compatibility_version : Separate<["-"], "dylib_compatibility_version">,
393    MetaVarName<"<version>">,
394    Alias<compatibility_version>,
395    HelpText<"Alias for -compatibility_version">,
396    Flags<[HelpHidden]>,
397    Group<grp_dylib>;
398def current_version : Separate<["-"], "current_version">,
399    MetaVarName<"<version>">,
400    HelpText<"Current <version> of this library">,
401    Group<grp_dylib>;
402def dylib_current_version : Separate<["-"], "dylib_current_version">,
403    MetaVarName<"<version>">,
404    Alias<current_version>,
405    HelpText<"Alias for -current_version">,
406    Flags<[HelpHidden]>,
407    Group<grp_dylib>;
408
409def grp_main : OptionGroup<"main">, HelpText<"MAIN EXECUTABLE">;
410
411def pie : Flag<["-"], "pie">,
412    HelpText<"Build a position independent executable (default)">,
413    Group<grp_main>;
414def no_pie : Flag<["-"], "no_pie">,
415    HelpText<"Do not build a position independent executable">,
416    Group<grp_main>;
417def pagezero_size : Separate<["-"], "pagezero_size">,
418    MetaVarName<"<size>">,
419    HelpText<"Size of unreadable segment at address zero is hex <size> (default is 4KB on 32-bit and 4GB on 64-bit)">,
420    Flags<[HelpHidden]>,
421    Group<grp_main>;
422def stack_size : Separate<["-"], "stack_size">,
423    MetaVarName<"<size>">,
424    HelpText<"Maximum hex stack size for the main thread in a program. (default is 8MB)">,
425    Flags<[HelpHidden]>,
426    Group<grp_main>;
427def allow_stack_execute : Flag<["-"], "allow_stack_execute">,
428    HelpText<"Mark stack segment as executable">,
429    Flags<[HelpHidden]>,
430    Group<grp_main>;
431def export_dynamic : Flag<["-"], "export_dynamic">,
432    HelpText<"Preserve all global symbols during LTO and when dead-stripping executables">,
433    Group<grp_main>;
434
435def grp_bundle : OptionGroup<"bundle">, HelpText<"CREATING A BUNDLE">;
436
437def bundle_loader : Separate<["-"], "bundle_loader">,
438    MetaVarName<"<executable>">,
439    HelpText<"Resolve undefined symbols from <executable>">,
440    Group<grp_bundle>;
441
442def grp_object : OptionGroup<"object">, HelpText<"CREATING AN OBJECT FILE">;
443
444def keep_private_externs : Flag<["-"], "keep_private_externs">,
445    HelpText<"Do not convert private external symbols to static symbols (only valid with -r)">,
446    Flags<[HelpHidden]>,
447    Group<grp_object>;
448def d : Flag<["-"], "d">,
449    HelpText<"Force tentative into real definitions for common symbols">,
450    Flags<[HelpHidden]>,
451    Group<grp_object>;
452
453def grp_resolve : OptionGroup<"resolve">, HelpText<"SYMBOL RESOLUTION">;
454
455def exported_symbol : Separate<["-"], "exported_symbol">,
456    MetaVarName<"<symbol>">,
457    HelpText<"<symbol> remains global, while others become private externs">,
458    Group<grp_resolve>;
459def exported_symbols_list : Separate<["-"], "exported_symbols_list">,
460    MetaVarName<"<file>">,
461    HelpText<"Symbols specified in <file> remain global, while others become private externs">,
462    Group<grp_resolve>;
463def unexported_symbol : Separate<["-"], "unexported_symbol">,
464    MetaVarName<"<symbol>">,
465    HelpText<"Global <symbol> becomes private extern">,
466    Group<grp_resolve>;
467def unexported_symbols_list : Separate<["-"], "unexported_symbols_list">,
468    MetaVarName<"<file>">,
469    HelpText<"Global symbols specified in <file> become private externs">,
470    Group<grp_resolve>;
471def reexported_symbols_list : Separate<["-"], "reexported_symbols_list">,
472    MetaVarName<"<file>">,
473    HelpText<"Symbols from dependent dylibs specified in <file> are reexported by this dylib">,
474    Flags<[HelpHidden]>,
475    Group<grp_resolve>;
476def alias : MultiArg<["-"], "alias", 2>,
477    MetaVarName<"<symbol_name> <alternate_name>">,
478    HelpText<"Create a symbol alias with default global visibility">,
479    Flags<[HelpHidden]>,
480    Group<grp_resolve>;
481def alias_list : Separate<["-"], "alias_list">,
482    MetaVarName<"<file>">,
483    HelpText<"Create symbol aliases specified in <file>">,
484    Flags<[HelpHidden]>,
485    Group<grp_resolve>;
486def flat_namespace : Flag<["-"], "flat_namespace">,
487    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">,
488    Group<grp_resolve>;
489def twolevel_namespace : Flag<["-"], "twolevel_namespace">,
490    HelpText<"Make dyld look up symbols by (dylib,name) pairs (default)">,
491    Group<grp_resolve>;
492def u : Separate<["-"], "u">,
493    MetaVarName<"<symbol>">,
494    HelpText<"Require that <symbol> be defined for the link to succeed">,
495    Group<grp_resolve>;
496def U : Separate<["-"], "U">,
497    MetaVarName<"<symbol>">,
498    HelpText<"Allow <symbol> to have no definition">,
499    Group<grp_resolve>;
500def undefined : Separate<["-"], "undefined">,
501    MetaVarName<"<treatment>">,
502    HelpText<"Handle undefined symbols according to <treatment>: error, warning, suppress, or dynamic_lookup (default is error)">,
503    Group<grp_resolve>;
504def rpath : Separate<["-"], "rpath">,
505    MetaVarName<"<path>">,
506    HelpText<"Add <path> to dyld search list for dylibs with load path prefix `@rpath/'">,
507    Group<grp_resolve>;
508def commons : Separate<["-"], "commons">,
509    MetaVarName<"<treatment>">,
510    HelpText<"Resolve tentative definitions in dylibs according to <treatment>: ignore_dylibs, use_dylibs, error (default is ignore_dylibs)">,
511    Flags<[HelpHidden]>,
512    Group<grp_resolve>;
513
514def grp_introspect : OptionGroup<"introspect">, HelpText<"INTROSPECTING THE LINKER">;
515
516def why_load : Flag<["-"], "why_load">,
517    HelpText<"Log why each object file is loaded from a static library">,
518    Group<grp_introspect>;
519def whyload : Flag<["-"], "whyload">,
520    Alias<why_load>,
521    HelpText<"Alias for -why_load">,
522    Group<grp_introspect>;
523def why_live : Separate<["-"], "why_live">,
524    MetaVarName<"<symbol>">,
525    HelpText<"Log a chain of references to <symbol>, for use with -dead_strip">,
526    Flags<[HelpHidden]>,
527    Group<grp_introspect>;
528def print_statistics : Flag<["-"], "print_statistics">,
529    HelpText<"Log the linker's memory and CPU usage">,
530    Flags<[HelpHidden]>,
531    Group<grp_introspect>;
532def t : Flag<["-"], "t">,
533    HelpText<"Log every file the linker loads: object, archive, and dylib">,
534    Group<grp_introspect>;
535def whatsloaded : Flag<["-"], "whatsloaded">,
536    HelpText<"Logs only the object files the linker loads">,
537    Flags<[HelpHidden]>,
538    Group<grp_introspect>;
539def order_file_statistics : Flag<["-"], "order_file_statistics">,
540    HelpText<"Logs information about -order_file">,
541    Flags<[HelpHidden]>,
542    Group<grp_introspect>;
543def map : Separate<["-"], "map">,
544    MetaVarName<"<path>">,
545    HelpText<"Writes all symbols and their addresses to <path>">,
546    Group<grp_introspect>;
547def dependency_info : Separate<["-"], "dependency_info">,
548    MetaVarName<"<path>">,
549    HelpText<"Dump dependency info">,
550    Group<grp_introspect>;
551def save_temps : Flag<["-"], "save-temps">,
552    HelpText<"Save intermediate LTO compilation results">,
553    Group<grp_introspect>;
554
555def grp_symtab : OptionGroup<"symtab">, HelpText<"SYMBOL TABLE">;
556
557def S : Flag<["-"], "S">,
558    HelpText<"Strip debug information (STABS or DWARF) from the output">,
559    Flags<[HelpHidden]>,
560    Group<grp_symtab>;
561def x : Flag<["-"], "x">,
562    HelpText<"Exclude non-global symbols from the output symbol table">,
563    Flags<[HelpHidden]>,
564    Group<grp_symtab>;
565def non_global_symbols_strip_list : Separate<["-"], "non_global_symbols_strip_list">,
566    MetaVarName<"<path>">,
567    HelpText<"Specify in <path> the non-global symbols that should be removed from the output symbol table">,
568    Flags<[HelpHidden]>,
569    Group<grp_symtab>;
570def non_global_symbols_no_strip_list : Separate<["-"], "non_global_symbols_no_strip_list">,
571    MetaVarName<"<path>">,
572    HelpText<"Specify in <path> the non-global symbols that should remain in the output symbol table">,
573    Flags<[HelpHidden]>,
574    Group<grp_symtab>;
575def oso_prefix : Separate<["-"], "oso_prefix">,
576    MetaVarName<"<path>">,
577    HelpText<"Remove the prefix <path> from OSO symbols in the debug map">,
578    Flags<[HelpHidden]>,
579    Group<grp_symtab>;
580def add_ast_path : Separate<["-"], "add_ast_path">,
581    MetaVarName<"<path>">,
582    HelpText<"AST paths will be emitted as STABS">,
583    Group<grp_symtab>;
584
585def grp_bitcode : OptionGroup<"bitcode">, HelpText<"BITCODE BUILD FLOW">;
586
587def bitcode_bundle : Flag<["-"], "bitcode_bundle">,
588    HelpText<"Generate an embedded bitcode bundle in the __LLVM,__bundle section of the output">,
589    Group<grp_bitcode>;
590def bitcode_hide_symbols : Flag<["-"], "bitcode_hide_symbols">,
591    HelpText<"With -bitcode_bundle, hide all non-exported symbols from output bitcode bundle.">,
592    Flags<[HelpHidden]>,
593    Group<grp_bitcode>;
594def bitcode_symbol_map : Separate<["-"], "bitcode_symbol_map">,
595    MetaVarName<"<path>">,
596    HelpText<"Write the bitcode symbol reverse mapping to file <path>, or if a directory, to <path>/UUID.bcsymbolmap">,
597    Flags<[HelpHidden]>,
598    Group<grp_bitcode>;
599
600def grp_rare : OptionGroup<"rare">, HelpText<"RARELY USED">;
601
602def v : Flag<["-"], "v">,
603    HelpText<"Print the linker version and search paths in addition to linking">,
604    Group<grp_rare>;
605def adhoc_codesign : Flag<["-"], "adhoc_codesign">,
606    HelpText<"Write an ad-hoc code signature to the output file (default for arm64 binaries)">,
607    Group<grp_rare>;
608def no_adhoc_codesign : Flag<["-"], "no_adhoc_codesign">,
609    HelpText<"Do not write an ad-hoc code signature to the output file (default for x86_64 binaries)">,
610    Group<grp_rare>;
611def version_details : Flag<["-"], "version_details">,
612    HelpText<"Print the linker version in JSON form">,
613    Flags<[HelpHidden]>,
614    Group<grp_rare>;
615def no_weak_imports : Flag<["-"], "no_weak_imports">,
616    HelpText<"Fail if any symbols are weak imports, allowed to be NULL at runtime">,
617    Flags<[HelpHidden]>,
618    Group<grp_rare>;
619def verbose_deduplicate : Flag<["-"], "verbose_deduplicate">,
620    HelpText<"Print function names eliminated by deduplication and the total size of code savings">,
621    Flags<[HelpHidden]>,
622    Group<grp_rare>;
623def no_inits : Flag<["-"], "no_inits">,
624    HelpText<"Fail if the output contains static initializers">,
625    Flags<[HelpHidden]>,
626    Group<grp_rare>;
627def no_warn_inits : Flag<["-"], "no_warn_inits">,
628    HelpText<"Suppress warnings for static initializers in the output">,
629    Flags<[HelpHidden]>,
630    Group<grp_rare>;
631def debug_variant : Flag<["-"], "debug_variant">,
632    HelpText<"Suppress warnings germane to binaries shipping to customers">,
633    Flags<[HelpHidden]>,
634    Group<grp_rare>;
635def unaligned_pointers : Separate<["-"], "unaligned_pointers">,
636    MetaVarName<"<treatment>">,
637    HelpText<"Handle unaligned pointers in __DATA segments according to <treatment>: warning, error, or suppress (default for arm64e is error, otherwise suppress)">,
638    Flags<[HelpHidden]>,
639    Group<grp_rare>;
640def dirty_data_list : Separate<["-"], "dirty_data_list">,
641    MetaVarName<"<path>">,
642    HelpText<"Specify data symbols in <path> destined for the __DATA_DIRTY segment">,
643    Flags<[HelpHidden]>,
644    Group<grp_rare>;
645def max_default_common_align : Separate<["-"], "max_default_common_align">,
646    MetaVarName<"<boundary>">,
647    HelpText<"Reduce maximum alignment for common symbols to a hex power-of-2 <boundary>">,
648    Flags<[HelpHidden]>,
649    Group<grp_rare>;
650def move_to_rw_segment : MultiArg<["-"], "move_to_rw_segment", 2>,
651    MetaVarName<"<segment> <path>">,
652    HelpText<"Move data symbols listed in <path> to another <segment>">,
653    Flags<[HelpHidden]>,
654    Group<grp_rare>;
655def move_to_ro_segment : MultiArg<["-"], "move_to_ro_segment", 2>,
656    MetaVarName<"<segment> <path>">,
657    HelpText<"Move code symbols listed in <path> to another <segment>">,
658    Flags<[HelpHidden]>,
659    Group<grp_rare>;
660def rename_section : MultiArg<["-"], "rename_section", 4>,
661    MetaVarName<"<from_segment> <from_section> <to_segment> <to_section>">,
662    HelpText<"Rename <from_segment>/<from_section> as <to_segment>/<to_section>">,
663    Group<grp_rare>;
664def rename_segment : MultiArg<["-"], "rename_segment", 2>,
665    MetaVarName<"<from_segment> <to_segment>">,
666    HelpText<"Rename <from_segment> as <to_segment>">,
667    Group<grp_rare>;
668def trace_symbol_layout : Flag<["-"], "trace_symbol_layout">,
669    HelpText<"Show where and why symbols move, as specified by -move_to_ro_segment, -move_to_rw_segment, -rename_section, and -rename_segment">,
670    Flags<[HelpHidden]>,
671    Group<grp_rare>;
672def data_const : Flag<["-"], "data_const">,
673    HelpText<"Force migration of readonly data into __DATA_CONST segment">,
674    Group<grp_rare>;
675def no_data_const : Flag<["-"], "no_data_const">,
676    HelpText<"Block migration of readonly data away from __DATA segment">,
677    Group<grp_rare>;
678def text_exec : Flag<["-"], "text_exec">,
679    HelpText<"Rename __segment TEXT to __TEXT_EXEC for sections __text and __stubs">,
680    Flags<[HelpHidden]>,
681    Group<grp_rare>;
682def section_order : MultiArg<["-"], "section_order", 2>,
683    MetaVarName<"<segment> <sections>">,
684    HelpText<"With -preload, specify layout sequence of colon-separated <sections> in <segment>">,
685    Flags<[HelpHidden]>,
686    Group<grp_rare>;
687def segment_order : Separate<["-"], "segment_order">,
688    MetaVarName<"<colon_separated_segment_list>">,
689    HelpText<"With -preload, specify layout sequence of colon-separated <segments>">,
690    Flags<[HelpHidden]>,
691    Group<grp_rare>;
692def allow_heap_execute : Flag<["-"], "allow_heap_execute">,
693    HelpText<"On i386, allow any page to execute code">,
694    Flags<[HelpHidden]>,
695    Group<grp_rare>;
696def application_extension : Flag<["-"], "application_extension">,
697    HelpText<"Mark output as safe for use in an application extension, and validate that linked dylibs are safe">,
698    Group<grp_rare>;
699def no_application_extension : Flag<["-"], "no_application_extension">,
700    HelpText<"Disable application extension functionality (default)">,
701    Group<grp_rare>;
702def fatal_warnings : Flag<["-"], "fatal_warnings">,
703    HelpText<"Treat warnings as errors">,
704    Group<grp_rare>;
705def no_eh_labels : Flag<["-"], "no_eh_labels">,
706    HelpText<"In -r mode, suppress .eh labels in the __eh_frame section">,
707    Flags<[HelpHidden]>,
708    Group<grp_rare>;
709def warn_compact_unwind : Flag<["-"], "warn_compact_unwind">,
710    HelpText<"Warn for each FDE that cannot compact into the __unwind_info section and must remain in the __eh_frame section">,
711    Flags<[HelpHidden]>,
712    Group<grp_rare>;
713def warn_weak_exports : Flag<["-"], "warn_weak_exports">,
714    HelpText<"Warn if the linked image contains weak external symbols">,
715    Flags<[HelpHidden]>,
716    Group<grp_rare>;
717def no_weak_exports : Flag<["-"], "no_weak_exports">,
718    HelpText<"Fail if the linked image contains weak external symbols">,
719    Flags<[HelpHidden]>,
720    Group<grp_rare>;
721def objc_gc_compaction : Flag<["-"], "objc_gc_compaction">,
722    HelpText<"Mark the Objective-C image as compatible with compacting garbage collection">,
723    Flags<[HelpHidden]>,
724    Group<grp_rare>;
725def objc_gc : Flag<["-"], "objc_gc">,
726    HelpText<"Verify that all code was compiled with -fobjc-gc or -fobjc-gc-only">,
727    Flags<[HelpHidden]>,
728    Group<grp_rare>;
729def objc_gc_only : Flag<["-"], "objc_gc_only">,
730    HelpText<"Verify that all code was compiled with -fobjc-gc-only">,
731    Flags<[HelpHidden]>,
732    Group<grp_rare>;
733def dead_strip_dylibs : Flag<["-"], "dead_strip_dylibs">,
734    HelpText<"Remove dylibs that are unreachable by the entry point or exported symbols">,
735    Group<grp_rare>;
736def allow_sub_type_mismatches : Flag<["-"], "allow_sub_type_mismatches">,
737    HelpText<"Permit mixing objects compiled for different ARM CPU subtypes">,
738    Flags<[HelpHidden]>,
739    Group<grp_rare>;
740def no_uuid : Flag<["-"], "no_uuid">,
741    HelpText<"Do not generate the LC_UUID load command">,
742    Flags<[HelpHidden]>,
743    Group<grp_rare>;
744def root_safe : Flag<["-"], "root_safe">,
745    HelpText<"Set the MH_ROOT_SAFE bit in the mach-o header">,
746    Flags<[HelpHidden]>,
747    Group<grp_rare>;
748def setuid_safe : Flag<["-"], "setuid_safe">,
749    HelpText<"Set the MH_SETUID_SAFE bit in the mach-o header">,
750    Flags<[HelpHidden]>,
751    Group<grp_rare>;
752def interposable : Flag<["-"], "interposable">,
753    HelpText<"Indirects access to all to exported symbols in a dylib">,
754    Flags<[HelpHidden]>,
755    Group<grp_rare>;
756def multi_module : Flag<["-"], "multi_module">,
757    Alias<interposable>,
758    HelpText<"Alias for -interposable">,
759    Flags<[HelpHidden]>,
760    Group<grp_rare>;
761def init : Separate<["-"], "init">,
762    MetaVarName<"<symbol>">,
763    HelpText<"Run <symbol> as the first initializer in a dylib">,
764    Flags<[HelpHidden]>,
765    Group<grp_rare>;
766def sub_library : Separate<["-"], "sub_library">,
767    MetaVarName<"<name>">,
768    HelpText<"Re-export the dylib as <name>">,
769    Group<grp_rare>;
770def sub_umbrella : Separate<["-"], "sub_umbrella">,
771    MetaVarName<"<name>">,
772    HelpText<"Re-export the framework as <name>">,
773    Group<grp_rare>;
774def allowable_client : Separate<["-"], "allowable_client">,
775    MetaVarName<"<name>">,
776    HelpText<"Specify <name> of a dylib or framework that is allowed to link to this dylib">,
777    Flags<[HelpHidden]>,
778    Group<grp_rare>;
779def client_name : Separate<["-"], "client_name">,
780    MetaVarName<"<name>">,
781    HelpText<"Specifies a <name> this client should match with the -allowable_client <name> in a dependent dylib">,
782    Flags<[HelpHidden]>,
783    Group<grp_rare>;
784def umbrella : Separate<["-"], "umbrella">,
785    MetaVarName<"<name>">,
786    HelpText<"Re-export this dylib through the umbrella framework <name>">,
787    Group<grp_rare>;
788def headerpad : Separate<["-"], "headerpad">,
789    MetaVarName<"<size>">,
790    HelpText<"Allocate hex <size> extra space for future expansion of the load commands via install_name_tool (default is 0x20)">,
791    Group<grp_rare>;
792def headerpad_max_install_names : Flag<["-"], "headerpad_max_install_names">,
793    HelpText<"Allocate extra space so all load-command paths can expand to MAXPATHLEN via install_name_tool">,
794    Group<grp_rare>;
795def bind_at_load : Flag<["-"], "bind_at_load">,
796    HelpText<"Tell dyld to bind all symbols at load time, rather than lazily">,
797    Flags<[HelpHidden]>,
798    Group<grp_rare>;
799def force_flat_namespace : Flag<["-"], "force_flat_namespace">,
800    HelpText<"Tell dyld to use a flat namespace on this executable and all its dependent dylibs & bundles">,
801    Flags<[HelpHidden]>,
802    Group<grp_rare>;
803def segalign : Separate<["-"], "segalign">,
804    MetaVarName<"<boundary>">,
805    HelpText<"Align all segments to hex power-of-2 <boundary>">,
806    Flags<[HelpHidden]>,
807    Group<grp_rare>;
808def sectalign : MultiArg<["-"], "sectalign", 3>,
809    MetaVarName<"<segment> <section> <boundary>">,
810    HelpText<"Align <section> within <segment> to hex power-of-2 <boundary>">,
811    Group<grp_rare>;
812def stack_addr : Separate<["-"], "stack_addr">,
813    MetaVarName<"<address>">,
814    HelpText<"Initialize stack pointer to hex <address> rounded to a page boundary">,
815    Flags<[HelpHidden]>,
816    Group<grp_rare>;
817def segprot : MultiArg<["-"], "segprot", 3>,
818    MetaVarName<"<segment> <max> <init>">,
819    HelpText<"Specifies the <max> and <init> virtual memory protection of <segment> as r/w/x/-seg_addr_table path">,
820    Group<grp_rare>;
821def segs_read_write_addr : Separate<["-"], "segs_read_write_addr">,
822    MetaVarName<"<address>">,
823    HelpText<"This option is obsolete">,
824    Flags<[HelpHidden]>,
825    Group<grp_rare>;
826def segs_read_only_addr : Separate<["-"], "segs_read_only_addr">,
827    MetaVarName<"<address>">,
828    HelpText<"This option is obsolete">,
829    Flags<[HelpHidden]>,
830    Group<grp_rare>;
831def segaddr : MultiArg<["-"], "segaddr", 2>,
832    MetaVarName<"<segment> <address>">,
833    HelpText<"Specify the starting hex <address> at a 4KiB page boundary for <segment>">,
834    Flags<[HelpHidden]>,
835    Group<grp_rare>;
836def seg_page_size : MultiArg<["-"], "seg_page_size", 2>,
837    MetaVarName<"<segment> <size>">,
838    HelpText<"Specifies the page <size> for <segment>. Segment size will be a multiple of its page size">,
839    Flags<[HelpHidden]>,
840    Group<grp_rare>;
841def dylib_file : Separate<["-"], "dylib_file">,
842    MetaVarName<"<install_path:current_path>">,
843    HelpText<"Specify <current_path> as different from where a dylib normally resides at <install_path>">,
844    Flags<[HelpHidden]>,
845    Group<grp_rare>;
846def weak_reference_mismatches : Separate<["-"], "weak_reference_mismatches">,
847    MetaVarName<"<treatment>">,
848    HelpText<"Resolve symbol imports of conflicting weakness according to <treatment> as weak, non-weak, or error (default is non-weak)">,
849    Flags<[HelpHidden]>,
850    Group<grp_rare>;
851def read_only_relocs : Separate<["-"], "read_only_relocs">,
852    MetaVarName<"<treatment>">,
853    HelpText<"Handle relocations that modify read-only pages according to <treatment> of warning, error, or suppress (i.e., allow)">,
854    Flags<[HelpHidden]>,
855    Group<grp_rare>;
856def force_cpusubtype_ALL : Flag<["-"], "force_cpusubtype_ALL">,
857    HelpText<"Mark binary as runnable on any PowerPC, ignoring any PowerPC cpu requirements encoded in the object files">,
858    Flags<[HelpHidden]>,
859    Group<grp_rare>;
860def no_arch_warnings : Flag<["-"], "no_arch_warnings">,
861    HelpText<"Suppresses warnings about inputs whose architecture does not match the -arch option">,
862    Flags<[HelpHidden]>,
863    Group<grp_rare>;
864def arch_errors_fatal : Flag<["-"], "arch_errors_fatal">,
865    HelpText<"Escalate to errors any warnings about inputs whose architecture does not match the -arch option">,
866    Flags<[HelpHidden]>,
867    Group<grp_rare>;
868def e : Separate<["-"], "e">,
869    MetaVarName<"<symbol>">,
870    HelpText<"Make <symbol> the entry point of an executable (default is \"start\" from crt1.o)">,
871    Group<grp_rare>;
872def w : Flag<["-"], "w">,
873    HelpText<"Suppress all warnings">,
874    Flags<[HelpHidden]>,
875    Group<grp_rare>;
876def final_output : Separate<["-"], "final_output">,
877    MetaVarName<"<name>">,
878    HelpText<"Specify dylib install name if -install_name is not used; used by compiler driver for multiple -arch arguments">,
879    Group<grp_rare>;
880def arch_multiple : Flag<["-"], "arch_multiple">,
881    HelpText<"Augment error and warning messages with the architecture name">,
882    Group<grp_rare>;
883def dot : Separate<["-"], "dot">,
884    MetaVarName<"<path>">,
885    HelpText<"Write a graph of symbol dependencies to <path> as a .dot file viewable with GraphViz">,
886    Flags<[HelpHidden]>,
887    Group<grp_rare>;
888def keep_relocs : Flag<["-"], "keep_relocs">,
889    HelpText<"Retain section-based relocation records in the output, which are ignored at runtime by dyld">,
890    Flags<[HelpHidden]>,
891    Group<grp_rare>;
892def warn_stabs : Flag<["-"], "warn_stabs">,
893    HelpText<"Warn when bad stab symbols inside a BINCL/EINCL prevent optimization">,
894    Flags<[HelpHidden]>,
895    Group<grp_rare>;
896def warn_commons : Flag<["-"], "warn_commons">,
897    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">,
898    Flags<[HelpHidden]>,
899    Group<grp_rare>;
900def read_only_stubs : Flag<["-"], "read_only_stubs">,
901    HelpText<"On i386, make the __IMPORT segment of a final linked image read-only">,
902    Flags<[HelpHidden]>,
903    Group<grp_rare>;
904def interposable_list : Separate<["-"], "interposable_list">,
905    MetaVarName<"<path>">,
906    HelpText<"Access global symbols listed in <path> indirectly">,
907    Flags<[HelpHidden]>,
908    Group<grp_rare>;
909def no_function_starts : Flag<["-"], "no_function_starts">,
910    HelpText<"Do not create table of function start addresses">,
911    Group<grp_rare>;
912def no_objc_category_merging : Flag<["-"], "no_objc_category_merging">,
913    HelpText<"Do not merge Objective-C categories into their classes">,
914    Flags<[HelpHidden]>,
915    Group<grp_rare>;
916def object_path_lto : Separate<["-"], "object_path_lto">,
917    MetaVarName<"<path>">,
918    HelpText<"Retain any temporary mach-o file in <path> that would otherwise be deleted during LTO">,
919    Group<grp_rare>;
920def cache_path_lto : Separate<["-"], "cache_path_lto">,
921    MetaVarName<"<path>">,
922    HelpText<"Use <path> as a directory for the incremental LTO cache">,
923    Group<grp_rare>;
924def prune_interval_lto : Separate<["-"], "prune_interval_lto">,
925    MetaVarName<"<seconds>">,
926    HelpText<"Prune the incremental LTO cache after <seconds> (-1 disables pruning)">,
927    Group<grp_rare>;
928def prune_after_lto : Separate<["-"], "prune_after_lto">,
929    MetaVarName<"<seconds>">,
930    HelpText<"Remove LTO cache entries after <seconds>">,
931    Group<grp_rare>;
932def max_relative_cache_size_lto : Separate<["-"], "max_relative_cache_size_lto">,
933    MetaVarName<"<percent>">,
934    HelpText<"Limit the incremental LTO cache growth to <percent> of free disk, space">,
935    Group<grp_rare>;
936def page_align_data_atoms : Flag<["-"], "page_align_data_atoms">,
937    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">,
938    Flags<[HelpHidden]>,
939    Group<grp_rare>;
940def not_for_dyld_shared_cache : Flag<["-"], "not_for_dyld_shared_cache">,
941    HelpText<"Prevent system dylibs from being placed into the dylib shared cache">,
942    Flags<[HelpHidden]>,
943    Group<grp_rare>;
944def mllvm : Separate<["-"], "mllvm">,
945    HelpText<"Options to pass to LLVM">,
946    Group<grp_rare>;
947def mcpu : Separate<["-"], "mcpu">,
948    HelpText<"Processor family target for LTO code generation">,
949    Group<grp_rare>;
950
951def grp_deprecated : OptionGroup<"deprecated">, HelpText<"DEPRECATED">;
952
953def lazy_framework : Separate<["-"], "lazy_framework">,
954    MetaVarName<"<name>">,
955    HelpText<"This option is deprecated and is now an alias for -framework.">,
956    Flags<[HelpHidden]>,
957    Group<grp_deprecated>;
958def lazy_library : Separate<["-"], "lazy_library">,
959    MetaVarName<"<path>">,
960    HelpText<"This option is deprecated and is now an alias for regular linking">,
961    Flags<[HelpHidden]>,
962    Group<grp_deprecated>;
963def lazy_l : Joined<["-"], "lazy-l">,
964    MetaVarName<"<name>">,
965    HelpText<"This option is deprecated and is now an alias for -l<path>.">,
966    Flags<[HelpHidden]>,
967    Group<grp_deprecated>;
968def single_module : Flag<["-"], "single_module">,
969    HelpText<"Unnecessary option: this is already the default">,
970    Flags<[HelpHidden]>,
971    Group<grp_deprecated>;
972def no_dead_strip_inits_and_terms : Flag<["-"], "no_dead_strip_inits_and_terms">,
973    HelpText<"Unnecessary option: initialization and termination are roots of the dead strip graph, so never dead stripped">,
974    Flags<[HelpHidden]>,
975    Group<grp_deprecated>;
976def noall_load : Flag<["-"], "noall_load">,
977    HelpText<"Unnecessary option: this is already the default">,
978    Flags<[HelpHidden]>,
979    Group<grp_deprecated>;
980
981def grp_obsolete : OptionGroup<"obsolete">, HelpText<"OBSOLETE">;
982
983def sectorder : MultiArg<["-"], "sectorder", 3>,
984    MetaVarName<"<segname> <sectname> <orderfile>">,
985    HelpText<"Obsolete. Replaced by more general -order_file option">,
986    Group<grp_obsolete>;
987def lto_library : Separate<["-"], "lto_library">,
988    MetaVarName<"<path>">,
989    HelpText<"Obsolete. LLD supports LTO directly, without using an external dylib.">,
990    Group<grp_obsolete>;
991def y : Joined<["-"], "y">,
992    MetaVarName<"<symbol>">,
993    HelpText<"This option is obsolete in ld64">,
994    Flags<[HelpHidden]>,
995    Group<grp_obsolete>;
996def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>,
997    MetaVarName<"<segname> <sectname>">,
998    HelpText<"This option is obsolete in ld64">,
999    Flags<[HelpHidden]>,
1000    Group<grp_obsolete>;
1001def nofixprebinding : Flag<["-"], "nofixprebinding">,
1002    HelpText<"This option is obsolete in ld64">,
1003    Flags<[HelpHidden]>,
1004    Group<grp_obsolete>;
1005def noprebind_all_twolevel_modules : Flag<["-"], "noprebind_all_twolevel_modules">,
1006    HelpText<"This option is obsolete in ld64">,
1007    Flags<[HelpHidden]>,
1008    Group<grp_obsolete>;
1009def prebind_all_twolevel_modules : Flag<["-"], "prebind_all_twolevel_modules">,
1010    HelpText<"This option is obsolete in ld64">,
1011    Flags<[HelpHidden]>,
1012    Group<grp_obsolete>;
1013def prebind_allow_overlap : Flag<["-"], "prebind_allow_overlap">,
1014    HelpText<"This option is obsolete in ld64">,
1015    Flags<[HelpHidden]>,
1016    Group<grp_obsolete>;
1017def noprebind : Flag<["-"], "noprebind">,
1018    HelpText<"This option is obsolete in ld64">,
1019    Flags<[HelpHidden]>,
1020    Group<grp_obsolete>;
1021def sect_diff_relocs : Separate<["-"], "sect_diff_relocs">,
1022    MetaVarName<"<treatment>">,
1023    HelpText<"This option is obsolete in ld64">,
1024    Flags<[HelpHidden]>,
1025    Group<grp_obsolete>;
1026def A : Separate<["-"], "A">,
1027    MetaVarName<"<basefile>">,
1028    HelpText<"This option is obsolete in ld64">,
1029    Flags<[HelpHidden]>,
1030    Group<grp_obsolete>;
1031def b : Flag<["-"], "b">,
1032    HelpText<"This option is obsolete in ld64">,
1033    Flags<[HelpHidden]>,
1034    Group<grp_obsolete>;
1035def Sn : Flag<["-"], "Sn">,
1036    HelpText<"This option is obsolete in ld64">,
1037    Flags<[HelpHidden]>,
1038    Group<grp_obsolete>;
1039def Si : Flag<["-"], "Si">,
1040    HelpText<"This option is obsolete in ld64">,
1041    Flags<[HelpHidden]>,
1042    Group<grp_obsolete>;
1043def Sp : Flag<["-"], "Sp">,
1044    HelpText<"This option is obsolete in ld64">,
1045    Flags<[HelpHidden]>,
1046    Group<grp_obsolete>;
1047def X : Flag<["-"], "X">,
1048    HelpText<"This option is obsolete in ld64">,
1049    Flags<[HelpHidden]>,
1050    Group<grp_obsolete>;
1051def s : Flag<["-"], "s">,
1052    HelpText<"This option is obsolete in ld64">,
1053    Flags<[HelpHidden]>,
1054    Group<grp_obsolete>;
1055def m : Flag<["-"], "m">,
1056    HelpText<"This option is obsolete in ld64">,
1057    Flags<[HelpHidden]>,
1058    Group<grp_obsolete>;
1059def Y : Separate<["-"], "Y">,
1060    MetaVarName<"<number>">,
1061    HelpText<"This option is obsolete in ld64">,
1062    Flags<[HelpHidden]>,
1063    Group<grp_obsolete>;
1064def nomultidefs : Flag<["-"], "nomultidefs">,
1065    HelpText<"This option is obsolete in ld64">,
1066    Flags<[HelpHidden]>,
1067    Group<grp_obsolete>;
1068def multiply_defined_unused : Separate<["-"], "multiply_defined_unused">,
1069    MetaVarName<"<treatment>">,
1070    HelpText<"This option is obsolete in ld64">,
1071    Flags<[HelpHidden]>,
1072    Group<grp_obsolete>;
1073def multiply_defined : Separate<["-"], "multiply_defined">,
1074    MetaVarName<"<treatment>">,
1075    HelpText<"This option is obsolete in ld64">,
1076    Flags<[HelpHidden]>,
1077    Group<grp_obsolete>;
1078def private_bundle : Flag<["-"], "private_bundle">,
1079    HelpText<"This option is obsolete in ld64">,
1080    Flags<[HelpHidden]>,
1081    Group<grp_obsolete>;
1082def seg_addr_table_filename : Separate<["-"], "seg_addr_table_filename">,
1083    MetaVarName<"<path>">,
1084    HelpText<"This option is obsolete in ld64">,
1085    Flags<[HelpHidden]>,
1086    Group<grp_obsolete>;
1087def sectorder_detail : Flag<["-"], "sectorder_detail">,
1088    HelpText<"This option is obsolete in ld64">,
1089    Flags<[HelpHidden]>,
1090    Group<grp_obsolete>;
1091def no_compact_linkedit : Flag<["-"], "no_compact_linkedit">,
1092    HelpText<"This option is obsolete in ld64">,
1093    Flags<[HelpHidden]>,
1094    Group<grp_obsolete>;
1095def dependent_dr_info : Flag<["-"], "dependent_dr_info">,
1096    HelpText<"This option is obsolete in ld64">,
1097    Flags<[HelpHidden]>,
1098    Group<grp_obsolete>;
1099def no_dependent_dr_info : Flag<["-"], "no_dependent_dr_info">,
1100    HelpText<"This option is obsolete in ld64">,
1101    Flags<[HelpHidden]>,
1102    Group<grp_obsolete>;
1103def seglinkedit : Flag<["-"], "seglinkedit">,
1104    HelpText<"This option is obsolete in ld64">,
1105    Flags<[HelpHidden]>,
1106    Group<grp_obsolete>;
1107def noseglinkedit : Flag<["-"], "noseglinkedit">,
1108    HelpText<"This option is obsolete in ld64">,
1109    Flags<[HelpHidden]>,
1110    Group<grp_obsolete>;
1111def fvmlib : Flag<["-"], "fvmlib">,
1112    HelpText<"This option is obsolete in ld64">,
1113    Flags<[HelpHidden]>,
1114    Group<grp_obsolete>;
1115def run_init_lazily : Flag<["-"], "run_init_lazily">,
1116    HelpText<"This option is obsolete in ld64">,
1117    Flags<[HelpHidden]>,
1118    Group<grp_obsolete>;
1119def prebind : Flag<["-"], "prebind">,
1120    HelpText<"This option is obsolete in ld64">,
1121    Flags<[HelpHidden]>,
1122    Group<grp_obsolete>;
1123def twolevel_namespace_hints : Flag<["-"], "twolevel_namespace_hints">,
1124    HelpText<"This option is obsolete in ld64">,
1125    Flags<[HelpHidden]>,
1126    Group<grp_obsolete>;
1127def slow_stubs : Flag<["-"], "slow_stubs">,
1128    HelpText<"This option is obsolete in ld64">,
1129    Flags<[HelpHidden]>,
1130    Group<grp_obsolete>;
1131
1132def grp_undocumented : OptionGroup<"undocumented">, HelpText<"UNDOCUMENTED">;
1133
1134def add_linker_option : Flag<["-"], "add_linker_option">,
1135    HelpText<"This option is undocumented in ld64">,
1136    Flags<[HelpHidden]>,
1137    Group<grp_undocumented>;
1138def add_source_version : Flag<["-"], "add_source_version">,
1139    HelpText<"This option is undocumented in ld64">,
1140    Flags<[HelpHidden]>,
1141    Group<grp_undocumented>;
1142def no_source_version : Flag<["-"], "no_source_version">,
1143    HelpText<"This option is undocumented in ld64">,
1144    Flags<[HelpHidden]>,
1145    Group<grp_undocumented>;
1146def add_split_seg_info : Flag<["-"], "add_split_seg_info">,
1147    HelpText<"This option is undocumented in ld64">,
1148    Flags<[HelpHidden]>,
1149    Group<grp_undocumented>;
1150def allow_dead_duplicates : Flag<["-"], "allow_dead_duplicates">,
1151    HelpText<"This option is undocumented in ld64">,
1152    Flags<[HelpHidden]>,
1153    Group<grp_undocumented>;
1154def allow_simulator_linking_to_macosx_dylibs : Flag<["-"], "allow_simulator_linking_to_macosx_dylibs">,
1155    HelpText<"This option is undocumented in ld64">,
1156    Flags<[HelpHidden]>,
1157    Group<grp_undocumented>;
1158def bitcode_process_mode : Flag<["-"], "bitcode_process_mode">,
1159    HelpText<"This option is undocumented in ld64">,
1160    Flags<[HelpHidden]>,
1161    Group<grp_undocumented>;
1162def bitcode_verify : Flag<["-"], "bitcode_verify">,
1163    HelpText<"This option is undocumented in ld64">,
1164    Flags<[HelpHidden]>,
1165    Group<grp_undocumented>;
1166def classic_linker : Flag<["-"], "classic_linker">,
1167    HelpText<"This option is undocumented in ld64">,
1168    Flags<[HelpHidden]>,
1169    Group<grp_undocumented>;
1170def data_in_code_info : Flag<["-"], "data_in_code_info">,
1171    HelpText<"Emit data-in-code information (default)">,
1172    Group<grp_undocumented>;
1173def no_data_in_code_info : Flag<["-"], "no_data_in_code_info">,
1174    HelpText<"Do not emit data-in-code information">,
1175    Group<grp_undocumented>;
1176def debug_snapshot : Flag<["-"], "debug_snapshot">,
1177    HelpText<"This option is undocumented in ld64">,
1178    Flags<[HelpHidden]>,
1179    Group<grp_undocumented>;
1180def demangle : Flag<["-"], "demangle">,
1181    HelpText<"Demangle symbol names in diagnostics">;
1182def dyld_env : Flag<["-"], "dyld_env">,
1183    HelpText<"This option is undocumented in ld64">,
1184    Flags<[HelpHidden]>,
1185    Group<grp_undocumented>;
1186def encryptable : Flag<["-"], "encryptable">,
1187    HelpText<"Generate the LC_ENCRYPTION_INFO load command">,
1188    Group<grp_undocumented>;
1189def no_encryption : Flag<["-"], "no_encryption">,
1190    HelpText<"Do not generate the LC_ENCRYPTION_INFO load command">,
1191    Group<grp_undocumented>;
1192def executable_path : Flag<["-"], "executable_path">,
1193    HelpText<"This option is undocumented in ld64">,
1194    Flags<[HelpHidden]>,
1195    Group<grp_undocumented>;
1196def fixup_chains : Flag<["-"], "fixup_chains">,
1197    HelpText<"This option is undocumented in ld64">,
1198    Flags<[HelpHidden]>,
1199    Group<grp_undocumented>;
1200def fixup_chains_section : Flag<["-"], "fixup_chains_section">,
1201    HelpText<"This option is undocumented in ld64">,
1202    Flags<[HelpHidden]>,
1203    Group<grp_undocumented>;
1204def flto_codegen_only : Flag<["-"], "flto-codegen-only">,
1205    HelpText<"This option is undocumented in ld64">,
1206    Flags<[HelpHidden]>,
1207    Group<grp_undocumented>;
1208def force_symbol_not_weak : Flag<["-"], "force_symbol_not_weak">,
1209    HelpText<"This option is undocumented in ld64">,
1210    Flags<[HelpHidden]>,
1211    Group<grp_undocumented>;
1212def force_symbols_coalesce_list : Flag<["-"], "force_symbols_coalesce_list">,
1213    HelpText<"This option is undocumented in ld64">,
1214    Flags<[HelpHidden]>,
1215    Group<grp_undocumented>;
1216def force_symbols_not_weak_list : Flag<["-"], "force_symbols_not_weak_list">,
1217    HelpText<"This option is undocumented in ld64">,
1218    Flags<[HelpHidden]>,
1219    Group<grp_undocumented>;
1220def force_symbols_weak_list : Flag<["-"], "force_symbols_weak_list">,
1221    HelpText<"This option is undocumented in ld64">,
1222    Flags<[HelpHidden]>,
1223    Group<grp_undocumented>;
1224def force_symbol_weak : Flag<["-"], "force_symbol_weak">,
1225    HelpText<"This option is undocumented in ld64">,
1226    Flags<[HelpHidden]>,
1227    Group<grp_undocumented>;
1228def function_starts : Flag<["-"], "function_starts">,
1229    HelpText<"Create table of function start addresses (default)">,
1230    Group<grp_undocumented>;
1231def i : Flag<["-"], "i">,
1232    HelpText<"This option is undocumented in ld64">,
1233    Flags<[HelpHidden]>,
1234    Group<grp_undocumented>;
1235def ignore_auto_link : Flag<["-"], "ignore_auto_link">,
1236    HelpText<"This option is undocumented in ld64">,
1237    Flags<[HelpHidden]>,
1238    Group<grp_undocumented>;
1239def ignore_optimization_hints : Flag<["-"], "ignore_optimization_hints">,
1240    HelpText<"This option is undocumented in ld64">,
1241    Flags<[HelpHidden]>,
1242    Group<grp_undocumented>;
1243def init_offsets : Flag<["-"], "init_offsets">,
1244    HelpText<"This option is undocumented in ld64">,
1245    Flags<[HelpHidden]>,
1246    Group<grp_undocumented>;
1247def keep_dwarf_unwind : Flag<["-"], "keep_dwarf_unwind">,
1248    HelpText<"This option is undocumented in ld64">,
1249    Flags<[HelpHidden]>,
1250    Group<grp_undocumented>;
1251def no_keep_dwarf_unwind : Flag<["-"], "no_keep_dwarf_unwind">,
1252    HelpText<"This option is undocumented in ld64">,
1253    Flags<[HelpHidden]>,
1254    Group<grp_undocumented>;
1255def kext : Flag<["-"], "kext">,
1256    HelpText<"This option is undocumented in ld64">,
1257    Flags<[HelpHidden]>,
1258    Group<grp_undocumented>;
1259def kext_objects_dir : Flag<["-"], "kext_objects_dir">,
1260    HelpText<"This option is undocumented in ld64">,
1261    Flags<[HelpHidden]>,
1262    Group<grp_undocumented>;
1263def no_kext_objects : Flag<["-"], "no_kext_objects">,
1264    HelpText<"This option is undocumented in ld64">,
1265    Flags<[HelpHidden]>,
1266    Group<grp_undocumented>;
1267def kexts_use_stubs : Flag<["-"], "kexts_use_stubs">,
1268    HelpText<"This option is undocumented in ld64">,
1269    Flags<[HelpHidden]>,
1270    Group<grp_undocumented>;
1271def no_compact_unwind : Flag<["-"], "no_compact_unwind">,
1272    HelpText<"This option is undocumented in ld64">,
1273    Flags<[HelpHidden]>,
1274    Group<grp_undocumented>;
1275def no_dtrace_dof : Flag<["-"], "no_dtrace_dof">,
1276    HelpText<"This option is undocumented in ld64">,
1277    Flags<[HelpHidden]>,
1278    Group<grp_undocumented>;
1279def no_new_main : Flag<["-"], "no_new_main">,
1280    HelpText<"This option is undocumented in ld64">,
1281    Flags<[HelpHidden]>,
1282    Group<grp_undocumented>;
1283def objc_abi_version : Separate<["-"], "objc_abi_version">,
1284    HelpText<"This option is undocumented in ld64">,
1285    Flags<[HelpHidden]>,
1286    Group<grp_undocumented>;
1287def pause : Flag<["-"], "pause">,
1288    HelpText<"This option is undocumented in ld64">,
1289    Flags<[HelpHidden]>,
1290    Group<grp_undocumented>;
1291def random_uuid : Flag<["-"], "random_uuid">,
1292    HelpText<"This option is undocumented in ld64">,
1293    Flags<[HelpHidden]>,
1294    Group<grp_undocumented>;
1295def simulator_support : Flag<["-"], "simulator_support">,
1296    HelpText<"This option is undocumented in ld64">,
1297    Flags<[HelpHidden]>,
1298    Group<grp_undocumented>;
1299def snapshot_dir : Flag<["-"], "snapshot_dir">,
1300    HelpText<"This option is undocumented in ld64">,
1301    Flags<[HelpHidden]>,
1302    Group<grp_undocumented>;
1303def source_version : Flag<["-"], "source_version">,
1304    HelpText<"This option is undocumented in ld64">,
1305    Flags<[HelpHidden]>,
1306    Group<grp_undocumented>;
1307def threaded_starts_section : Flag<["-"], "threaded_starts_section">,
1308    HelpText<"This option is undocumented in ld64">,
1309    Flags<[HelpHidden]>,
1310    Group<grp_undocumented>;
1311def verbose_optimization_hints : Flag<["-"], "verbose_optimization_hints">,
1312    HelpText<"This option is undocumented in ld64">,
1313    Flags<[HelpHidden]>,
1314    Group<grp_undocumented>;
1315def version_load_command : Flag<["-"], "version_load_command">,
1316    HelpText<"This option is undocumented in ld64">,
1317    Flags<[HelpHidden]>,
1318    Group<grp_undocumented>;
1319
1320def grp_ignored : OptionGroup<"ignored">, HelpText<"IGNORED">;
1321
1322def M : Flag<["-"], "M">,
1323    HelpText<"This option is ignored in ld64">,
1324    Flags<[HelpHidden]>,
1325    Group<grp_ignored>;
1326def new_linker : Flag<["-"], "new_linker">,
1327    HelpText<"This option is ignored in ld64">,
1328    Flags<[HelpHidden]>,
1329    Group<grp_ignored>;
1330