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