Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 1 | include "llvm/Option/OptParser.td" |
| 2 | |
| 3 | class F<string name>: Flag<["--", "-"], name>; |
| 4 | class J<string name>: Joined<["--", "-"], name>; |
| 5 | class S<string name>: Separate<["--", "-"], name>; |
| 6 | |
| 7 | def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">, |
| 8 | HelpText<"Add a directory to the library search path">; |
Martin Storsjo | d79a4b7 | 2019-01-29 19:24:32 | [diff] [blame] | 9 | def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">; |
| 10 | def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">; |
Martin Storsjo | 094d8c0 | 2017-11-15 08:18:11 | [diff] [blame] | 11 | def dynamicbase: F<"dynamicbase">, HelpText<"Enable ASLR">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 12 | def entry: S<"entry">, MetaVarName<"<entry>">, |
| 13 | HelpText<"Name of entry point symbol">; |
Martin Storsjo | 9705898 | 2019-02-19 21:57:49 | [diff] [blame^] | 14 | def exclude_all_symbols: F<"exclude-all-symbols">, |
| 15 | HelpText<"Don't automatically export any symbols">; |
Martin Storsjo | a84a477 | 2017-10-12 05:37:18 | [diff] [blame] | 16 | def export_all_symbols: F<"export-all-symbols">, |
| 17 | HelpText<"Export all symbols even if a def file or dllexport attributes are used">; |
Martin Storsjo | b190fd2 | 2017-11-15 08:18:20 | [diff] [blame] | 18 | def gc_sections: F<"gc-sections">, HelpText<"Remove unused sections">; |
| 19 | def icf: J<"icf=">, HelpText<"Identical code folding">; |
Martin Storsjo | e916868 | 2017-11-15 08:18:15 | [diff] [blame] | 20 | def image_base: S<"image-base">, HelpText<"Base address of the program">; |
Martin Storsjo | dfb2fcd | 2019-02-06 21:05:29 | [diff] [blame] | 21 | def insert_timestamp: F<"insert-timestamp">, |
| 22 | HelpText<"Include PE header timestamp">; |
Martin Storsjo | fb36e6e | 2018-03-14 20:17:24 | [diff] [blame] | 23 | def kill_at: F<"kill-at">, HelpText<"Remove @n from exported symbols">; |
Rui Ueyama | c3e4602 | 2017-09-11 20:54:51 | [diff] [blame] | 24 | def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">, |
| 25 | HelpText<"Root name of library to use">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 26 | def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; |
Martin Storsjo | 0366155 | 2018-05-15 21:12:29 | [diff] [blame] | 27 | def map: S<"Map">, HelpText<"Output a linker map">; |
| 28 | def map_eq: J<"Map=">, Alias<map>; |
Martin Storsjo | 537a718 | 2019-02-05 08:16:06 | [diff] [blame] | 29 | def no_insert_timestamp: F<"no-insert-timestamp">, |
| 30 | HelpText<"Don't include PE header timestamp">; |
Martin Storsjo | 32e1626 | 2017-09-13 07:28:09 | [diff] [blame] | 31 | def no_whole_archive: F<"no-whole-archive">, |
| 32 | HelpText<"No longer include all object files for following archives">; |
Martin Storsjo | 3c8d4b5 | 2017-11-15 08:18:06 | [diff] [blame] | 33 | def large_address_aware: Flag<["--"], "large-address-aware">, |
| 34 | HelpText<"Enable large addresses">; |
Martin Storsjo | b190fd2 | 2017-11-15 08:18:20 | [diff] [blame] | 35 | def no_gc_sections: F<"no-gc-sections">, HelpText<"Don't remove unused sections">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 36 | def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">, |
| 37 | HelpText<"Path to file to write output">; |
Rui Ueyama | c3e4602 | 2017-09-11 20:54:51 | [diff] [blame] | 38 | def out_implib: Separate<["--"], "out-implib">, HelpText<"Import library name">; |
Martin Storsjo | 27af6b0 | 2017-10-26 20:11:58 | [diff] [blame] | 39 | def out_implib_eq: Joined<["--"], "out-implib=">, Alias<out_implib>; |
Martin Storsjo | a84a477 | 2017-10-12 05:37:18 | [diff] [blame] | 40 | def output_def: S<"output-def">, HelpText<"Output def file">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 41 | def shared: F<"shared">, HelpText<"Build a shared object">; |
Rui Ueyama | 1f4cdcf | 2017-09-14 18:33:21 | [diff] [blame] | 42 | def subs: S<"subsystem">, HelpText<"Specify subsystem">; |
| 43 | def stack: S<"stack">; |
Martin Storsjo | 068512d | 2017-11-03 22:10:37 | [diff] [blame] | 44 | def strip_all: F<"strip-all">, |
| 45 | HelpText<"Omit all symbol information from the output binary">; |
Martin Storsjo | c082674 | 2018-06-29 06:08:31 | [diff] [blame] | 46 | def strip_debug: F<"strip-debug">, |
| 47 | HelpText<"Omit all debug information, but keep symbol information">; |
Martin Storsjo | 32e1626 | 2017-09-13 07:28:09 | [diff] [blame] | 48 | def whole_archive: F<"whole-archive">, |
| 49 | HelpText<"Include all object files for following archives">; |
Martin Storsjo | a79762a | 2017-09-11 20:43:39 | [diff] [blame] | 50 | def verbose: F<"verbose">, HelpText<"Verbose mode">; |
Martin Storsjo | db62913 | 2018-09-10 17:41:40 | [diff] [blame] | 51 | def require_defined: S<"require-defined">, |
| 52 | HelpText<"Force symbol to be added to symbol table as an undefined one">; |
| 53 | def require_defined_eq: J<"require-defined=">, Alias<require_defined>; |
Martin Storsjo | a79762a | 2017-09-11 20:43:39 | [diff] [blame] | 54 | |
| 55 | // LLD specific options |
| 56 | def _HASH_HASH_HASH : Flag<["-"], "###">, |
| 57 | HelpText<"Print (but do not run) the commands to run for this compilation">; |
Martin Storsjo | 107b548 | 2017-11-03 07:18:37 | [diff] [blame] | 58 | def mllvm: S<"mllvm">; |
Martin Storsjo | b7d5011 | 2018-05-15 06:34:18 | [diff] [blame] | 59 | def pdb: S<"pdb">, HelpText<"Specify output PDB debug information file">; |
Martin Storsjo | 107b548 | 2017-11-03 07:18:37 | [diff] [blame] | 60 | def Xlink : J<"Xlink=">, MetaVarName<"<arg>">, |
| 61 | HelpText<"Pass <arg> to the COFF linker">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 62 | |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 63 | // Alias |
| 64 | def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>; |
Martin Storsjo | 068512d | 2017-11-03 22:10:37 | [diff] [blame] | 65 | def alias_strip_s: Flag<["-"], "s">, Alias<strip_all>; |
Martin Storsjo | c082674 | 2018-06-29 06:08:31 | [diff] [blame] | 66 | def alias_strip_S: Flag<["-"], "S">, Alias<strip_debug>; |
Martin Storsjo | 5d1862b | 2019-01-29 08:38:48 | [diff] [blame] | 67 | |
| 68 | // Ignored options |
Martin Storsjo | d79a4b7 | 2019-01-29 19:24:32 | [diff] [blame] | 69 | def: Joined<["-"], "O">; |
| 70 | def: F<"build-id">; |
| 71 | def: F<"disable-auto-image-base">; |
| 72 | def: F<"enable-auto-image-base">; |
| 73 | def: F<"enable-auto-import">; |
| 74 | def: F<"end-group">; |
| 75 | def: Flag<["--"], "full-shutdown">; |
| 76 | def: F<"high-entropy-va">; |
| 77 | def: S<"major-image-version">; |
| 78 | def: S<"minor-image-version">; |
| 79 | def: F<"no-seh">; |
| 80 | def: F<"nxcompat">; |
| 81 | def: F<"pic-executable">; |
Martin Storsjo | 5d1862b | 2019-01-29 08:38:48 | [diff] [blame] | 82 | def: S<"plugin">; |
| 83 | def: J<"plugin=">; |
| 84 | def: S<"plugin-opt">; |
| 85 | def: J<"plugin-opt=">; |
Martin Storsjo | d79a4b7 | 2019-01-29 19:24:32 | [diff] [blame] | 86 | def: J<"sysroot">; |
| 87 | def: F<"start-group">; |
| 88 | def: F<"tsaware">; |
| 89 | def: Flag<["-"], "v">; |
| 90 | def: F<"version">; |