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 | 094d8c0 | 2017-11-15 08:18:11 | [diff] [blame^] | 9 | def dynamicbase: F<"dynamicbase">, HelpText<"Enable ASLR">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 10 | def entry: S<"entry">, MetaVarName<"<entry>">, |
| 11 | HelpText<"Name of entry point symbol">; |
Martin Storsjo | a84a477 | 2017-10-12 05:37:18 | [diff] [blame] | 12 | def export_all_symbols: F<"export-all-symbols">, |
| 13 | HelpText<"Export all symbols even if a def file or dllexport attributes are used">; |
Rui Ueyama | c3e4602 | 2017-09-11 20:54:51 | [diff] [blame] | 14 | def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">, |
| 15 | HelpText<"Root name of library to use">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 16 | def m: JoinedOrSeparate<["-"], "m">, HelpText<"Set target emulation">; |
Martin Storsjo | 32e1626 | 2017-09-13 07:28:09 | [diff] [blame] | 17 | def no_whole_archive: F<"no-whole-archive">, |
| 18 | HelpText<"No longer include all object files for following archives">; |
Martin Storsjo | 3c8d4b5 | 2017-11-15 08:18:06 | [diff] [blame] | 19 | def large_address_aware: Flag<["--"], "large-address-aware">, |
| 20 | HelpText<"Enable large addresses">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 21 | def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">, |
| 22 | HelpText<"Path to file to write output">; |
Rui Ueyama | c3e4602 | 2017-09-11 20:54:51 | [diff] [blame] | 23 | def out_implib: Separate<["--"], "out-implib">, HelpText<"Import library name">; |
Martin Storsjo | 27af6b0 | 2017-10-26 20:11:58 | [diff] [blame] | 24 | def out_implib_eq: Joined<["--"], "out-implib=">, Alias<out_implib>; |
Martin Storsjo | a84a477 | 2017-10-12 05:37:18 | [diff] [blame] | 25 | def output_def: S<"output-def">, HelpText<"Output def file">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 26 | def shared: F<"shared">, HelpText<"Build a shared object">; |
Rui Ueyama | 1f4cdcf | 2017-09-14 18:33:21 | [diff] [blame] | 27 | def subs: S<"subsystem">, HelpText<"Specify subsystem">; |
| 28 | def stack: S<"stack">; |
Martin Storsjo | 068512d | 2017-11-03 22:10:37 | [diff] [blame] | 29 | def strip_all: F<"strip-all">, |
| 30 | HelpText<"Omit all symbol information from the output binary">; |
Martin Storsjo | 32e1626 | 2017-09-13 07:28:09 | [diff] [blame] | 31 | def whole_archive: F<"whole-archive">, |
| 32 | HelpText<"Include all object files for following archives">; |
Martin Storsjo | a79762a | 2017-09-11 20:43:39 | [diff] [blame] | 33 | def verbose: F<"verbose">, HelpText<"Verbose mode">; |
| 34 | |
| 35 | // LLD specific options |
| 36 | def _HASH_HASH_HASH : Flag<["-"], "###">, |
| 37 | HelpText<"Print (but do not run) the commands to run for this compilation">; |
Martin Storsjo | 107b548 | 2017-11-03 07:18:37 | [diff] [blame] | 38 | def mllvm: S<"mllvm">; |
| 39 | def Xlink : J<"Xlink=">, MetaVarName<"<arg>">, |
| 40 | HelpText<"Pass <arg> to the COFF linker">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 41 | |
| 42 | // Currently stubs to avoid errors |
| 43 | def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">; |
| 44 | def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">; |
Rui Ueyama | c3e4602 | 2017-09-11 20:54:51 | [diff] [blame] | 45 | def O: Joined<["-"], "O">, HelpText<"Optimize output file size">; |
Rui Ueyama | 1f4cdcf | 2017-09-14 18:33:21 | [diff] [blame] | 46 | def enable_auto_image_base: F<"enable-auto-image-base">; |
Martin Storsjo | ab9c98c | 2017-10-26 20:12:01 | [diff] [blame] | 47 | def enable_auto_import: F<"enable-auto-import">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 48 | def full_shutdown: Flag<["--"], "full-shutdown">; |
Martin Storsjo | 094d8c0 | 2017-11-15 08:18:11 | [diff] [blame^] | 49 | def high_entropy_va: F<"high-entropy-va">, HelpText<"Enable 64-bit ASLR">; |
Rui Ueyama | 1f4cdcf | 2017-09-14 18:33:21 | [diff] [blame] | 50 | def major_image_version: S<"major-image-version">; |
| 51 | def minor_image_version: S<"minor-image-version">; |
Martin Storsjo | 094d8c0 | 2017-11-15 08:18:11 | [diff] [blame^] | 52 | def nxcompat: F<"nxcompat">, HelpText<"Enable data execution prevention">; |
Martin Storsjo | 5d5aa21 | 2017-09-11 20:43:43 | [diff] [blame] | 53 | def sysroot: J<"sysroot">, HelpText<"Sysroot">; |
Martin Storsjo | 094d8c0 | 2017-11-15 08:18:11 | [diff] [blame^] | 54 | def tsaware: F<"tsaware">, HelpText<"Create Terminal Server aware executable">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 55 | def v: Flag<["-"], "v">, HelpText<"Display the version number">; |
Martell Malone | 894dbbe | 2017-09-11 17:02:59 | [diff] [blame] | 56 | def version: F<"version">, HelpText<"Display the version number and exit">; |
| 57 | |
| 58 | // Alias |
| 59 | def alias_entry_e: JoinedOrSeparate<["-"], "e">, Alias<entry>; |
Martin Storsjo | 068512d | 2017-11-03 22:10:37 | [diff] [blame] | 60 | def alias_strip_s: Flag<["-"], "s">, Alias<strip_all>; |