]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lld/ELF/Options.td
Adjust ENA driver files to latest ena-com changes
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lld / ELF / Options.td
1 include "llvm/Option/OptParser.td"
2
3 // Convenience classes for long options which only accept two dashes. For lld
4 // specific or newer long options, we prefer two dashes to avoid collision with
5 // short options. For many others, we have to accept both forms to be compatible
6 // with GNU ld.
7 class FF<string name> : Flag<["--"], name>;
8 class JJ<string name>: Joined<["--"], name>;
9
10 multiclass EEq<string name, string help> {
11   def NAME: Separate<["--"], name>;
12   def NAME # _eq: Joined<["--"], name # "=">, Alias<!cast<Separate>(NAME)>,
13     HelpText<help>;
14 }
15
16 multiclass BB<string name, string help1, string help2> {
17   def NAME: Flag<["--"], name>, HelpText<help1>;
18   def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
19 }
20
21 // For options whose names are multiple letters, either one dash or
22 // two can precede the option name except those that start with 'o'.
23 class F<string name>: Flag<["--", "-"], name>;
24 class J<string name>: Joined<["--", "-"], name>;
25
26 multiclass Eq<string name, string help> {
27   def NAME: Separate<["--", "-"], name>;
28   def NAME # _eq: Joined<["--", "-"], name # "=">, Alias<!cast<Separate>(NAME)>,
29     HelpText<help>;
30 }
31
32 multiclass B<string name, string help1, string help2> {
33   def NAME: Flag<["--", "-"], name>, HelpText<help1>;
34   def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>;
35 }
36
37 defm auxiliary: Eq<"auxiliary", "Set DT_AUXILIARY field to the specified name">;
38
39 def Bsymbolic: F<"Bsymbolic">, HelpText<"Bind defined symbols locally">;
40
41 def Bsymbolic_functions: F<"Bsymbolic-functions">,
42   HelpText<"Bind defined function symbols locally">;
43
44 def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries (default)">;
45
46 def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">;
47
48 def build_id: F<"build-id">, HelpText<"Alias for --build-id=fast">;
49
50 def build_id_eq: J<"build-id=">, HelpText<"Generate build ID note">,
51   MetaVarName<"[fast,md5,sha1,uuid,0x<hexstring>]">;
52
53 defm check_sections: B<"check-sections",
54     "Check section addresses for overlaps (default)",
55     "Do not check section addresses for overlaps">;
56
57 defm compress_debug_sections:
58   Eq<"compress-debug-sections", "Compress DWARF debug sections">,
59   MetaVarName<"[none,zlib]">;
60
61 defm defsym: Eq<"defsym", "Define a symbol alias">, MetaVarName<"<symbol>=<value>">;
62
63 defm optimize_bb_jumps: BB<"optimize-bb-jumps",
64     "Remove direct jumps at the end to the next basic block",
65     "Do not remove any direct jumps at the end to the next basic block (default)">;
66
67 defm split_stack_adjust_size
68     : Eq<"split-stack-adjust-size",
69          "Specify adjustment to stack size when a split-stack function calls a "
70          "non-split-stack function">,
71       MetaVarName<"<value>">;
72
73 defm library_path:
74   Eq<"library-path", "Add a directory to the library search path">, MetaVarName<"<dir>">;
75
76 def O: JoinedOrSeparate<["-"], "O">, HelpText<"Optimize output file size">;
77
78 defm Tbss: Eq<"Tbss", "Same as --section-start with .bss as the sectionname">;
79
80 defm Tdata: Eq<"Tdata", "Same as --section-start with .data as the sectionname">;
81
82 defm Ttext: Eq<"Ttext", "Same as --section-start with .text as the sectionname">;
83
84 def Ttext_segment: Separate<["-", "--"], "Ttext-segment">;
85
86 defm allow_multiple_definition: B<"allow-multiple-definition",
87     "Allow multiple definitions",
88     "Do not allow multiple definitions (default)">;
89
90 defm allow_shlib_undefined: B<"allow-shlib-undefined",
91     "Allow unresolved references in shared libraries (default when linking a shared library)",
92     "Do not allow unresolved references in shared libraries (default when linking an executable)">;
93
94 defm apply_dynamic_relocs: BB<"apply-dynamic-relocs",
95     "Apply link-time values for dynamic relocations",
96     "Do not apply link-time values for dynamic relocations (default)">;
97
98 defm dependent_libraries: BB<"dependent-libraries",
99     "Process dependent library specifiers from input files (default)",
100     "Ignore dependent library specifiers from input files">;
101
102 defm as_needed: B<"as-needed",
103     "Only set DT_NEEDED for shared libraries if used",
104     "Always set DT_NEEDED for shared libraries (default)">;
105
106 defm call_graph_ordering_file:
107   Eq<"call-graph-ordering-file", "Layout sections to optimize the given callgraph">;
108
109 defm call_graph_profile_sort: BB<"call-graph-profile-sort",
110     "Reorder sections with call graph profile (default)",
111     "Do not reorder sections with call graph profile">;
112
113 // -chroot doesn't have a help text because it is an internal option.
114 def chroot: Separate<["--", "-"], "chroot">;
115
116 def color_diagnostics: F<"color-diagnostics">,
117   HelpText<"Alias for --color-diagnostics=always">;
118
119 def color_diagnostics_eq: J<"color-diagnostics=">,
120   HelpText<"Use colors in diagnostics">,
121   MetaVarName<"[auto,always,never]">;
122
123 defm cref: B<"cref",
124     "Output cross reference table",
125     "Do not output cross reference table">;
126
127 defm define_common: B<"define-common",
128     "Assign space to common symbols",
129     "Do not assign space to common symbols">;
130
131 defm demangle: B<"demangle",
132     "Demangle symbol names (default)",
133     "Do not demangle symbol names">;
134
135 def disable_new_dtags: F<"disable-new-dtags">,
136   HelpText<"Disable new dynamic tags">;
137
138 def discard_all: F<"discard-all">, HelpText<"Delete all local symbols">;
139
140 def discard_locals: F<"discard-locals">,
141   HelpText<"Delete temporary local symbols">;
142
143 def discard_none: F<"discard-none">,
144   HelpText<"Keep all symbols in the symbol table">;
145
146 defm dynamic_linker: Eq<"dynamic-linker", "Which dynamic linker to use">;
147
148 defm dynamic_list : Eq<"dynamic-list",
149    "Read a list of dynamic symbols. (executable) Put matched non-local defined"
150    "symbols to the dynamic symbol table. (shared object) References to matched"
151    "non-local STV_DEFAULT symbols shouldn't be bound to definitions within the "
152    "shared object. Implies -Bsymbolic but does not set DF_SYMBOLIC">,
153    MetaVarName<"<file>">;
154
155 defm eh_frame_hdr: B<"eh-frame-hdr",
156     "Request creation of .eh_frame_hdr section and PT_GNU_EH_FRAME segment header",
157     "Do not create .eh_frame_hdr section">;
158
159 def emit_relocs: F<"emit-relocs">, HelpText<"Generate relocations in output">;
160
161 def enable_new_dtags: F<"enable-new-dtags">,
162   HelpText<"Enable new dynamic tags (default)">;
163
164 def end_group: F<"end-group">,
165   HelpText<"Ignored for compatibility with GNU unless you pass --warn-backrefs">;
166
167 def end_lib: F<"end-lib">,
168   HelpText<"End a grouping of objects that should be treated as if they were together in an archive">;
169
170 defm entry: Eq<"entry", "Name of entry point symbol">,
171   MetaVarName<"<entry>">;
172
173 defm error_limit:
174   Eq<"error-limit", "Maximum number of errors to emit before stopping (0 = no limit)">;
175
176 def error_unresolved_symbols: F<"error-unresolved-symbols">,
177   HelpText<"Report unresolved symbols as errors">;
178
179 defm exclude_libs: Eq<"exclude-libs", "Exclude static libraries from automatic export">;
180
181 defm execute_only: BB<"execute-only",
182     "Mark executable sections unreadable",
183     "Mark executable sections readable (default)">;
184
185 defm export_dynamic: B<"export-dynamic",
186     "Put symbols in the dynamic symbol table",
187     "Do not put symbols in the dynamic symbol table (default)">;
188
189 defm export_dynamic_symbol : EEq<"export-dynamic-symbol",
190     "(executable) Put matched symbols in the dynamic symbol table. "
191     "(shared object) References to matched non-local STV_DEFAULT symbols "
192     "shouldn't be bound to definitions within the shared object. "
193     "Does not imply -Bsymbolic.">,
194     MetaVarName<"glob">;
195
196 defm fatal_warnings: B<"fatal-warnings",
197     "Treat warnings as errors",
198     "Do not treat warnings as errors (default)">;
199
200 defm filter: Eq<"filter", "Set DT_FILTER field to the specified name">;
201
202 defm fini: Eq<"fini", "Specify a finalizer function">, MetaVarName<"<symbol>">;
203
204 def fix_cortex_a53_843419: F<"fix-cortex-a53-843419">,
205   HelpText<"Apply fixes for AArch64 Cortex-A53 erratum 843419">;
206
207 def fix_cortex_a8: F<"fix-cortex-a8">,
208   HelpText<"Apply fixes for ARM Cortex-A8 erratum 657417">;
209
210 defm format: Eq<"format", "Change the input format of the inputs following this option">,
211   MetaVarName<"[default,elf,binary]">;
212
213 defm gc_sections: B<"gc-sections",
214     "Enable garbage collection of unused sections",
215     "Disable garbage collection of unused sections (default)">;
216
217 defm gdb_index: BB<"gdb-index",
218     "Generate .gdb_index section",
219     "Do not generate .gdb_index section (default)">;
220
221 defm gnu_unique: BB<"gnu-unique",
222   "Enable STB_GNU_UNIQUE symbol binding (default)",
223   "Disable STB_GNU_UNIQUE symbol binding">;
224
225 defm hash_style: Eq<"hash-style", "Specify hash style (sysv, gnu or both)">;
226
227 def help: F<"help">, HelpText<"Print option help">;
228
229 def icf_all: F<"icf=all">, HelpText<"Enable identical code folding">;
230
231 def icf_safe: F<"icf=safe">, HelpText<"Enable safe identical code folding">;
232
233 def icf_none: F<"icf=none">, HelpText<"Disable identical code folding (default)">;
234
235 def ignore_function_address_equality: F<"ignore-function-address-equality">,
236   HelpText<"lld can break the address equality of functions">;
237
238 def ignore_data_address_equality: F<"ignore-data-address-equality">,
239   HelpText<"lld can break the address equality of data">;
240
241 defm image_base: Eq<"image-base", "Set the base address">;
242
243 defm init: Eq<"init", "Specify an initializer function">,
244   MetaVarName<"<symbol>">;
245
246 defm just_symbols: Eq<"just-symbols", "Just link symbols">;
247
248 defm keep_unique: Eq<"keep-unique", "Do not fold this symbol during ICF">;
249
250 defm library: Eq<"library", "Root name of library to use">,
251   MetaVarName<"<libName>">;
252
253 def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">;
254
255 defm Map: Eq<"Map", "Print a link map to the specified file">;
256
257 defm merge_exidx_entries: B<"merge-exidx-entries",
258     "Enable merging .ARM.exidx entries (default)",
259     "Disable merging .ARM.exidx entries">;
260
261 defm mmap_output_file: BB<"mmap-output-file",
262     "Mmap the output file for writing (default)",
263     "Do not mmap the output file for writing">;
264
265 def nmagic: F<"nmagic">, MetaVarName<"<magic>">,
266   HelpText<"Do not page align sections, link against static libraries.">;
267
268 def nostdlib: F<"nostdlib">,
269   HelpText<"Only search directories specified on the command line">;
270
271 def no_color_diagnostics: F<"no-color-diagnostics">,
272   HelpText<"Do not use colors in diagnostics">;
273
274 def no_dynamic_linker: F<"no-dynamic-linker">,
275   HelpText<"Inhibit output of .interp section">;
276
277 def noinhibit_exec: F<"noinhibit-exec">,
278   HelpText<"Retain the executable output file whenever it is still usable">;
279
280 def no_nmagic: F<"no-nmagic">, MetaVarName<"<magic>">,
281   HelpText<"Page align sections (default)">;
282
283 def no_omagic: F<"no-omagic">, MetaVarName<"<magic>">,
284   HelpText<"Do not set the text data sections to be writable, page align sections (default)">;
285
286 def no_undefined: F<"no-undefined">,
287   HelpText<"Report unresolved symbols even if the linker is creating a shared library">;
288
289 def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
290   HelpText<"Path to file to write output">;
291
292 def oformat: Separate<["--"], "oformat">, MetaVarName<"<format>">,
293   HelpText<"Specify the binary format for the output object file">;
294
295 def omagic: FF<"omagic">, MetaVarName<"<magic>">,
296   HelpText<"Set the text and data sections to be readable and writable, do not page align sections, link against static libraries">;
297
298 defm orphan_handling:
299   Eq<"orphan-handling", "Control how orphan sections are handled when linker script used">;
300
301 defm pack_dyn_relocs:
302   Eq<"pack-dyn-relocs", "Pack dynamic relocations in the given format">,
303   MetaVarName<"[none,android,relr,android+relr]">;
304
305 defm use_android_relr_tags: BB<"use-android-relr-tags",
306     "Use SHT_ANDROID_RELR / DT_ANDROID_RELR* tags instead of SHT_RELR / DT_RELR*",
307     "Use SHT_RELR / DT_RELR* tags (default)">;
308
309 def pic_veneer: F<"pic-veneer">,
310   HelpText<"Always generate position independent thunks (veneers)">;
311
312 defm pie: B<"pie",
313     "Create a position independent executable",
314     "Do not create a position independent executable (default)">;
315
316 defm print_gc_sections: B<"print-gc-sections",
317     "List removed unused sections",
318     "Do not list removed unused sections (default)">;
319
320 defm print_icf_sections: B<"print-icf-sections",
321     "List identical folded sections",
322     "Do not list identical folded sections (default)">;
323
324 def print_archive_stats: J<"print-archive-stats=">,
325   HelpText<"Write archive usage statistics to the specified file. "
326            "Print the numbers of members and fetched members for each archive">;
327
328 defm print_symbol_order: Eq<"print-symbol-order",
329   "Print a symbol order specified by --call-graph-ordering-file into the specified file">;
330
331 def pop_state: F<"pop-state">,
332   HelpText<"Undo the effect of -push-state">;
333
334 def push_state: F<"push-state">,
335   HelpText<"Save the current state of -as-needed, -static and -whole-archive">;
336
337 def print_map: F<"print-map">,
338   HelpText<"Print a link map to the standard output">;
339
340 defm reproduce: Eq<"reproduce", "Write a tar file containing input files and command line options to reproduce link">;
341
342 defm rosegment: BB<"rosegment",
343   "Put read-only non-executable sections in their own segment (default)",
344   "Do not put read-only non-executable sections in their own segment">;
345
346 defm rpath: Eq<"rpath", "Add a DT_RUNPATH to the output">;
347
348 def relocatable: F<"relocatable">, HelpText<"Create relocatable object file">;
349
350 defm retain_symbols_file:
351   Eq<"retain-symbols-file", "Retain only the symbols listed in the file">,
352   MetaVarName<"<file>">;
353
354 defm script: Eq<"script", "Read linker script">;
355
356 defm section_start: Eq<"section-start", "Set address of section">,
357   MetaVarName<"<address>">;
358
359 def shared: F<"shared">, HelpText<"Build a shared object">;
360
361 defm soname: Eq<"soname", "Set DT_SONAME">;
362
363 defm sort_section:
364   Eq<"sort-section", "Specifies sections sorting rule when linkerscript is used">;
365
366 def start_group: F<"start-group">,
367   HelpText<"Ignored for compatibility with GNU unless you pass --warn-backrefs">;
368
369 def start_lib: F<"start-lib">,
370   HelpText<"Start a grouping of objects that should be treated as if they were together in an archive">;
371
372 def strip_all: F<"strip-all">, HelpText<"Strip all symbols">;
373
374 def strip_debug: F<"strip-debug">, HelpText<"Strip debugging information">;
375
376 defm symbol_ordering_file:
377   Eq<"symbol-ordering-file", "Layout sections to place symbols in the order specified by symbol ordering file">;
378
379 defm sysroot: Eq<"sysroot", "Set the system root">;
380
381 def target1_rel: F<"target1-rel">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_REL32">;
382
383 def target1_abs: F<"target1-abs">, HelpText<"Interpret R_ARM_TARGET1 as R_ARM_ABS32 (default)">;
384
385 defm target2:
386   Eq<"target2", "Interpret R_ARM_TARGET2 as <type>, where <type> is one of rel, abs, or got-rel">,
387   MetaVarName<"<type>">;
388
389 defm threads
390     : Eq<"threads",
391          "Number of threads. '1' disables multi-threading. By default all "
392          "available hardware threads are used">;
393
394 def time_trace: F<"time-trace">, HelpText<"Record time trace">;
395 def time_trace_file_eq: J<"time-trace-file=">, HelpText<"Specify time trace output file">;
396
397 defm time_trace_granularity: Eq<"time-trace-granularity",
398   "Minimum time granularity (in microseconds) traced by time profiler">;
399
400 defm toc_optimize : B<"toc-optimize",
401     "(PowerPC64) Enable TOC related optimizations (default)",
402     "(PowerPC64) Disable TOC related optimizations">;
403
404 def trace: F<"trace">, HelpText<"Print the names of the input files">;
405
406 defm trace_symbol: Eq<"trace-symbol", "Trace references to symbols">;
407
408 defm undefined: Eq<"undefined", "Force undefined symbol during linking">,
409   MetaVarName<"<symbol>">;
410
411 defm undefined_glob: Eq<"undefined-glob", "Force undefined symbol during linking">,
412   MetaVarName<"<pattern>">;
413
414 def unique: F<"unique">, HelpText<"Creates a separate output section for every orphan input section">;
415
416 defm unresolved_symbols:
417   Eq<"unresolved-symbols", "Determine how to handle unresolved symbols">;
418
419 defm undefined_version: B<"undefined-version",
420   "Allow unused version in version script (default)",
421   "Report version scripts that refer undefined symbols">;
422
423 defm rsp_quoting: Eq<"rsp-quoting", "Quoting style for response files">,
424   MetaVarName<"[posix,windows]">;
425
426 def v: Flag<["-"], "v">, HelpText<"Display the version number">;
427
428 def verbose: F<"verbose">, HelpText<"Verbose mode">;
429
430 def version: F<"version">, HelpText<"Display the version number and exit">;
431
432 defm version_script: Eq<"version-script", "Read a version script">;
433
434 defm warn_backrefs: BB<"warn-backrefs",
435     "Warn about backward symbol references to fetch archive members",
436     "Do not warn about backward symbol references to fetch archive members (default)">;
437
438 defm warn_backrefs_exclude
439     : EEq<"warn-backrefs-exclude",
440          "Glob describing an archive (or an object file within --start-lib) "
441          "which should be ignored for --warn-backrefs.">,
442       MetaVarName<"<glob>">;
443
444 defm warn_common: B<"warn-common",
445     "Warn about duplicate common symbols",
446     "Do not warn about duplicate common symbols (default)">;
447
448 defm warn_ifunc_textrel: BB<"warn-ifunc-textrel",
449     "Warn about using ifunc symbols with text relocations",
450     "Do not warn about using ifunc symbols with text relocations (default)">;
451
452 defm warn_symbol_ordering: BB<"warn-symbol-ordering",
453     "Warn about problems with the symbol ordering file (default)",
454     "Do not warn about problems with the symbol ordering file">;
455
456 def warn_unresolved_symbols: F<"warn-unresolved-symbols">,
457   HelpText<"Report unresolved symbols as warnings">;
458
459 defm whole_archive: B<"whole-archive",
460     "Force load of all members in a static library",
461     "Do not force load of all members in a static library (default)">;
462
463 defm wrap: Eq<"wrap", "Use wrapper functions for symbol">,
464   MetaVarName<"<symbol>=<symbol>">;
465
466 def z: JoinedOrSeparate<["-"], "z">, MetaVarName<"<option>">,
467   HelpText<"Linker option extensions">;
468
469 def visual_studio_diagnostics_format : F<"vs-diagnostics">,
470 HelpText<"Format diagnostics for Visual Studio compatibility">;
471
472 // Aliases
473 def: Separate<["-"], "f">, Alias<auxiliary>, HelpText<"Alias for --auxiliary">;
474 def: F<"call_shared">, Alias<Bdynamic>, HelpText<"Alias for --Bdynamic">;
475 def: F<"dy">, Alias<Bdynamic>, HelpText<"Alias for --Bdynamic">;
476 def: F<"dn">, Alias<Bstatic>, HelpText<"Alias for --Bstatic">;
477 def: F<"non_shared">, Alias<Bstatic>, HelpText<"Alias for --Bstatic">;
478 def: F<"static">, Alias<Bstatic>, HelpText<"Alias for --Bstatic">;
479 def: Flag<["-"], "d">, Alias<define_common>, HelpText<"Alias for --define-common">;
480 def: F<"dc">, Alias<define_common>, HelpText<"Alias for --define-common">;
481 def: F<"dp">, Alias<define_common>, HelpText<"Alias for --define-common">;
482 def: Flag<["-"], "x">, Alias<discard_all>, HelpText<"Alias for --discard-all">;
483 def: Flag<["-"], "X">, Alias<discard_locals>, HelpText<"Alias for --discard-locals">;
484 def: Flag<["-"], "q">, Alias<emit_relocs>, HelpText<"Alias for --emit-relocs">;
485 def: Flag<["-"], ")">, Alias<end_group>, HelpText<"Alias for --end-group">;
486 def: JoinedOrSeparate<["-"], "e">, Alias<entry>, HelpText<"Alias for --entry">;
487 def: Flag<["-"], "E">, Alias<export_dynamic>, HelpText<"Alias for --export-dynamic">;
488 def: Separate<["-"], "F">, Alias<filter>, HelpText<"Alias for --filter">;
489 def: Separate<["-"], "b">, Alias<format>, HelpText<"Alias for --format">;
490 def: JoinedOrSeparate<["-"], "l">, Alias<library>, HelpText<"Alias for --library">;
491 def: JoinedOrSeparate<["-"], "L">, Alias<library_path>, HelpText<"Alias for --library-path">;
492 def: F<"no-pic-executable">, Alias<no_pie>, HelpText<"Alias for --no-pie">;
493 def: Flag<["-"], "n">, Alias<nmagic>, HelpText<"Alias for --nmagic">;
494 def: Flag<["-"], "N">, Alias<omagic>, HelpText<"Alias for --omagic">;
495 def: Joined<["--"], "output=">, Alias<o>, HelpText<"Alias for -o">;
496 def: Separate<["--"], "output">, Alias<o>, HelpText<"Alias for -o">;
497 def: F<"pic-executable">, Alias<pie>, HelpText<"Alias for --pie">;
498 def: Flag<["-"], "M">, Alias<print_map>, HelpText<"Alias for --print-map">;
499 def: Flag<["-"], "r">, Alias<relocatable>, HelpText<"Alias for --relocatable">;
500 def: JoinedOrSeparate<["-"], "R">, Alias<rpath>, HelpText<"Alias for --rpath">;
501 def: JoinedOrSeparate<["-"], "T">, Alias<script>, HelpText<"Alias for --script">;
502 def: F<"Bshareable">, Alias<shared>, HelpText<"Alias for --shared">;
503 def: JoinedOrSeparate<["-"], "h">, Alias<soname>, HelpText<"Alias for --soname">;
504 def: Flag<["-"], "(">, Alias<start_group>, HelpText<"Alias for --start-group">;
505 def: Flag<["-"], "s">, Alias<strip_all>, HelpText<"Alias for --strip-all">;
506 def: Flag<["-"], "S">, Alias<strip_debug>, HelpText<"Alias for --strip-debug">;
507 def: Flag<["-"], "t">, Alias<trace>, HelpText<"Alias for --trace">;
508 def: Joined<["-", "--"], "Ttext-segment=">, Alias<Ttext_segment>;
509 def: JoinedOrSeparate<["-"], "y">, Alias<trace_symbol>, HelpText<"Alias for --trace-symbol">;
510 def: JoinedOrSeparate<["-"], "u">, Alias<undefined>, HelpText<"Alias for --undefined">;
511 def: Flag<["-"], "V">, Alias<version>, HelpText<"Alias for --version">;
512
513 // LTO-related options.
514 def lto_aa_pipeline: JJ<"lto-aa-pipeline=">,
515   HelpText<"AA pipeline to run during LTO. Used in conjunction with -lto-newpm-passes">;
516 def lto_debug_pass_manager: FF<"lto-debug-pass-manager">,
517   HelpText<"Debug new pass manager">;
518 def lto_emit_asm: FF<"lto-emit-asm">,
519   HelpText<"Emit assembly code">;
520 def lto_new_pass_manager: FF<"lto-new-pass-manager">,
521   HelpText<"Use new pass manager">;
522 def lto_newpm_passes: JJ<"lto-newpm-passes=">,
523   HelpText<"Passes to run during LTO">;
524 def lto_O: JJ<"lto-O">, MetaVarName<"<opt-level>">,
525   HelpText<"Optimization level for LTO">;
526 def lto_partitions: JJ<"lto-partitions=">,
527   HelpText<"Number of LTO codegen partitions">;
528 def lto_cs_profile_generate: FF<"lto-cs-profile-generate">,
529   HelpText<"Perform context sensitive PGO instrumentation">;
530 def lto_cs_profile_file: JJ<"lto-cs-profile-file=">,
531   HelpText<"Context sensitive profile file path">;
532 def lto_obj_path_eq: JJ<"lto-obj-path=">;
533 def lto_sample_profile: JJ<"lto-sample-profile=">,
534   HelpText<"Sample profile file path">;
535 def lto_whole_program_visibility: FF<"lto-whole-program-visibility">,
536   HelpText<"Asserts that the LTO link has whole program visibility">;
537 def disable_verify: F<"disable-verify">;
538 defm mllvm: Eq<"mllvm", "Additional arguments to forward to LLVM's option processing">;
539 def opt_remarks_filename: Separate<["--"], "opt-remarks-filename">,
540   HelpText<"YAML output file for optimization remarks">;
541 def opt_remarks_passes: Separate<["--"], "opt-remarks-passes">,
542   HelpText<"Regex for the passes that need to be serialized to the output file">;
543 def opt_remarks_with_hotness: FF<"opt-remarks-with-hotness">,
544   HelpText<"Include hotness information in the optimization remarks file">;
545 def opt_remarks_format: Separate<["--"], "opt-remarks-format">,
546   HelpText<"The format used for serializing remarks (default: YAML)">;
547 def save_temps: F<"save-temps">;
548 def lto_basicblock_sections: JJ<"lto-basicblock-sections=">,
549   HelpText<"Enable basic block sections for LTO">;
550 defm lto_unique_bb_section_names: BB<"lto-unique-bb-section-names",
551     "Give unique names to every basic block section for LTO",
552     "Do not give unique names to every basic block section for LTO (default)">;
553 def shuffle_sections: JJ<"shuffle-sections=">, MetaVarName<"<seed>">,
554   HelpText<"Shuffle input sections using the given seed. If 0, use a random seed">;
555 def thinlto_cache_dir: JJ<"thinlto-cache-dir=">,
556   HelpText<"Path to ThinLTO cached object file directory">;
557 defm thinlto_cache_policy: EEq<"thinlto-cache-policy", "Pruning policy for the ThinLTO cache">;
558 def thinlto_emit_imports_files: FF<"thinlto-emit-imports-files">;
559 def thinlto_index_only: FF<"thinlto-index-only">;
560 def thinlto_index_only_eq: JJ<"thinlto-index-only=">;
561 def thinlto_jobs: JJ<"thinlto-jobs=">,
562   HelpText<"Number of ThinLTO jobs. Default to --threads=">;
563 def thinlto_object_suffix_replace_eq: JJ<"thinlto-object-suffix-replace=">;
564 def thinlto_prefix_replace_eq: JJ<"thinlto-prefix-replace=">;
565 def thinlto_single_module_eq: JJ<"thinlto-single-module=">,
566   HelpText<"Specific a single module to compile in ThinLTO mode, for debugging only">;
567
568 def: J<"plugin-opt=O">, Alias<lto_O>, HelpText<"Alias for --lto-O">;
569 def: F<"plugin-opt=debug-pass-manager">,
570   Alias<lto_debug_pass_manager>, HelpText<"Alias for --lto-debug-pass-manager">;
571 def: F<"plugin-opt=disable-verify">, Alias<disable_verify>, HelpText<"Alias for --disable-verify">;
572 def plugin_opt_dwo_dir_eq: J<"plugin-opt=dwo_dir=">,
573   HelpText<"Directory to store .dwo files when LTO and debug fission are used">;
574 def plugin_opt_emit_asm: F<"plugin-opt=emit-asm">,
575   Alias<lto_emit_asm>, HelpText<"Alias for --lto-emit-asm">;
576 def plugin_opt_emit_llvm: F<"plugin-opt=emit-llvm">;
577 def: J<"plugin-opt=jobs=">, Alias<thinlto_jobs>, HelpText<"Alias for --thinlto-jobs">;
578 def: J<"plugin-opt=lto-partitions=">, Alias<lto_partitions>, HelpText<"Alias for --lto-partitions">;
579 def plugin_opt_mcpu_eq: J<"plugin-opt=mcpu=">;
580 def: F<"plugin-opt=new-pass-manager">,
581   Alias<lto_new_pass_manager>, HelpText<"Alias for --lto-new-pass-manager">;
582 def: F<"plugin-opt=cs-profile-generate">,
583   Alias<lto_cs_profile_generate>, HelpText<"Alias for --lto-cs-profile-generate">;
584 def: J<"plugin-opt=cs-profile-path=">,
585   Alias<lto_cs_profile_file>, HelpText<"Alias for --lto-cs-profile-file">;
586 def: J<"plugin-opt=obj-path=">,
587   Alias<lto_obj_path_eq>,
588   HelpText<"Alias for --lto-obj-path=">;
589 def: J<"plugin-opt=sample-profile=">,
590   Alias<lto_sample_profile>, HelpText<"Alias for --lto-sample-profile">;
591 def: F<"plugin-opt=save-temps">, Alias<save_temps>, HelpText<"Alias for --save-temps">;
592 def: F<"plugin-opt=thinlto-emit-imports-files">,
593   Alias<thinlto_emit_imports_files>,
594   HelpText<"Alias for --thinlto-emit-imports-files">;
595 def: F<"plugin-opt=thinlto-index-only">,
596   Alias<thinlto_index_only>,
597   HelpText<"Alias for --thinlto-index-only">;
598 def: J<"plugin-opt=thinlto-index-only=">,
599   Alias<thinlto_index_only_eq>,
600   HelpText<"Alias for --thinlto-index-only=">;
601 def: J<"plugin-opt=thinlto-object-suffix-replace=">,
602  Alias<thinlto_object_suffix_replace_eq>,
603  HelpText<"Alias for --thinlto-object-suffix-replace=">;
604 def: J<"plugin-opt=thinlto-prefix-replace=">,
605   Alias<thinlto_prefix_replace_eq>,
606   HelpText<"Alias for --thinlto-prefix-replace=">;
607
608 // Ignore LTO plugin-related options.
609 // clang -flto passes -plugin and -plugin-opt to the linker. This is required
610 // for ld.gold and ld.bfd to get LTO working. But it's not for lld which doesn't
611 // rely on a plugin. Instead of detecting which linker is used on clang side we
612 // just ignore the option on lld side as it's easier. In fact, the linker could
613 // be called 'ld' and understanding which linker is used would require parsing of
614 // --version output.
615 defm plugin: Eq<"plugin", "Ignored for compatibility with GNU linkers">;
616
617 def plugin_opt_eq_minus: J<"plugin-opt=-">,
618   HelpText<"Specify an LLVM option for compatibility with LLVMgold.so">;
619 def: J<"plugin-opt=thinlto">;
620
621 // Ignore GCC collect2 LTO plugin related options. Note that we don't support
622 // GCC LTO, but GCC collect2 passes these options even in non-LTO mode.
623 def: J<"plugin-opt=-fresolution=">;
624 def: J<"plugin-opt=-pass-through=">;
625 // This may be either an unhandled LLVMgold.so feature or GCC passed
626 // -plugin-opt=path/to/{liblto_plugin.so,lto-wrapper}
627 def plugin_opt_eq : J<"plugin-opt=">;
628
629 // Options listed below are silently ignored for now for compatibility.
630 def: F<"detect-odr-violations">;
631 def: Flag<["-"], "g">;
632 def: F<"long-plt">;
633 def: F<"no-add-needed">;
634 def: F<"no-copy-dt-needed-entries">;
635 def: F<"no-ctors-in-init-array">;
636 def: F<"no-keep-memory">;
637 def: F<"no-pipeline-knowledge">;
638 def: F<"no-relax">;
639 def: F<"no-warn-mismatch">;
640 def: Flag<["-"], "p">;
641 def: Separate<["--", "-"], "rpath-link">;
642 def: J<"rpath-link=">;
643 def: F<"secure-plt">;
644 def: F<"sort-common">;
645 def: F<"stats">;
646 def: F<"warn-execstack">;
647 def: F<"warn-once">;
648 def: F<"warn-shared-textrel">;
649 def: F<"EB">;
650 def: F<"EL">;
651 def: JoinedOrSeparate<["-"], "G">;
652 def: F<"Qy">;
653
654 // Hidden option used for testing MIPS multi-GOT implementation.
655 defm mips_got_size:
656   Eq<"mips-got-size", "Max size of a single MIPS GOT. 0x10000 by default.">,
657   Flags<[HelpHidden]>;