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