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