Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 1 | include "llvm/Option/OptParser.td" |
| 2 | |
| 3 | // link.exe accepts options starting with either a dash or a slash. |
| 4 | |
| 5 | // Flag that takes no arguments. |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 6 | class F<string name> : Flag<["/", "-", "/?", "-?"], name>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 7 | |
| 8 | // Flag that takes one argument after ":". |
| 9 | class P<string name, string help> : |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 10 | Joined<["/", "-", "/?", "-?"], name#":">, HelpText<help>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 11 | |
Martin Storsjö | 45c4c54 | 2020-10-03 22:29:45 | [diff] [blame] | 12 | // Same as P<> above, but without help texts, for private undocumented |
| 13 | // options. |
| 14 | class P_priv<string name> : |
| 15 | Joined<["/", "-", "/?", "-?"], name#":">; |
| 16 | |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 17 | // Boolean flag which can be suffixed by ":no". Using it unsuffixed turns the |
| 18 | // flag on and using it suffixed by ":no" turns it off. |
| 19 | multiclass B<string name, string help_on, string help_off> { |
| 20 | def "" : F<name>, HelpText<help_on>; |
| 21 | def _no : F<name#":no">, HelpText<help_off>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 22 | } |
| 23 | |
Martin Storsjö | 7f0e6c3 | 2020-04-25 21:49:44 | [diff] [blame] | 24 | // Same as B<> above, but without help texts, for private undocumented |
| 25 | // options. |
| 26 | multiclass B_priv<string name> { |
| 27 | def "" : F<name>; |
| 28 | def _no : F<name#":no">; |
| 29 | } |
| 30 | |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 31 | def align : P<"align", "Section alignment">; |
Martin Storsjo | d2752aa | 2017-08-14 19:07:27 | [diff] [blame] | 32 | def aligncomm : P<"aligncomm", "Set common symbol alignment">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 33 | def alternatename : P<"alternatename", "Define weak alias">; |
| 34 | def base : P<"base", "Base address of the program">; |
Nico Weber | cac2b33 | 2018-05-10 18:19:02 | [diff] [blame] | 35 | def color_diagnostics: Flag<["--"], "color-diagnostics">, |
Nico Weber | baa2aa2 | 2020-11-17 17:15:42 | [diff] [blame] | 36 | HelpText<"Alias for --color-diagnostics=always">; |
| 37 | def no_color_diagnostics: Flag<["--"], "no-color-diagnostics">, |
| 38 | HelpText<"Alias for --color-diagnostics=never">; |
Nico Weber | cac2b33 | 2018-05-10 18:19:02 | [diff] [blame] | 39 | def color_diagnostics_eq: Joined<["--"], "color-diagnostics=">, |
Nico Weber | baa2aa2 | 2020-11-17 17:15:42 | [diff] [blame] | 40 | HelpText<"Use colors in diagnostics (default: auto)">, |
| 41 | MetaVarName<"[auto,always,never]">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 42 | def defaultlib : P<"defaultlib", "Add the library to the list of input files">; |
| 43 | def delayload : P<"delayload", "Delay loaded DLL name">; |
Peter Kasting | c5fb05f | 2022-02-16 14:20:03 | [diff] [blame] | 44 | def diasdkdir : P<"diasdkdir", "Set the location of the DIA SDK">; |
Haohai Wen | 2a631a8 | 2023-07-01 00:58:56 | [diff] [blame] | 45 | def dwodir : P<"dwodir", |
| 46 | "Directory to store .dwo files when LTO and debug fission are used">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 47 | def entry : P<"entry", "Name of entry point symbol">; |
Bob Haarman | ac8f7fc | 2017-04-05 00:43:54 | [diff] [blame] | 48 | def errorlimit : P<"errorlimit", |
| 49 | "Maximum number of errors to emit before stopping (0 = no limit)">; |
Martin Storsjö | d1da646 | 2022-07-18 20:43:02 | [diff] [blame] | 50 | def exclude_symbols : P<"exclude-symbols", "Exclude symbols from automatic export">, |
| 51 | MetaVarName<"<symbol[,symbol,...]>">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 52 | def export : P<"export", "Export a function">; |
| 53 | // No help text because /failifmismatch is not intended to be used by the user. |
| 54 | def failifmismatch : P<"failifmismatch", "">; |
Rui Ueyama | 74de620 | 2019-05-24 12:42:36 | [diff] [blame] | 55 | def filealign : P<"filealign", "Section alignment in the output file">; |
Alexandre Ganea | d307c4c | 2019-02-23 01:46:18 | [diff] [blame] | 56 | def functionpadmin : F<"functionpadmin">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 57 | def functionpadmin_opt : P<"functionpadmin", |
| 58 | "Prepares an image for hotpatching">; |
Aleksei Nurmukhametov | 76947e0 | 2023-11-08 20:21:05 | [diff] [blame] | 59 | def dependentloadflag : F<"dependentloadflag">; |
| 60 | def dependentloadflag_opt : P<"dependentloadflag", |
| 61 | "Sets the default load flags used to resolve the statically linked imports of a module">; |
Reid Kleckner | af2f7da | 2018-02-06 01:58:26 | [diff] [blame] | 62 | def guard : P<"guard", "Control flow guard">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 63 | def heap : P<"heap", "Size of the heap">; |
Bob Haarman | e90ac01 | 2017-12-28 07:02:13 | [diff] [blame] | 64 | def ignore : P<"ignore", "Specify warning codes to ignore">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 65 | def implib : P<"implib", "Import library name">; |
Tobias Hieta | eb4eef9 | 2022-04-12 14:06:46 | [diff] [blame] | 66 | def noimplib : F<"noimplib">, |
| 67 | HelpText<"Don't output an import lib">; |
Nico Weber | c421fe5 | 2018-07-14 04:07:51 | [diff] [blame] | 68 | def lib : F<"lib">, |
| 69 | HelpText<"Act like lib.exe; must be first argument if present">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 70 | def libpath : P<"libpath", "Additional library search path">; |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 71 | def linkrepro : Joined<["/", "-", "/?", "-?"], "linkrepro:">, |
| 72 | MetaVarName<"directory">, |
| 73 | HelpText<"Write repro.tar containing inputs and command to reproduce link">; |
Nico Weber | d48ea5d | 2019-09-13 13:13:52 | [diff] [blame] | 74 | def lldignoreenv : F<"lldignoreenv">, |
| 75 | HelpText<"Ignore environment variables like %LIB%">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 76 | def lldltocache : P<"lldltocache", |
| 77 | "Path to ThinLTO cached object file directory">; |
| 78 | def lldltocachepolicy : P<"lldltocachepolicy", |
| 79 | "Pruning policy for the ThinLTO cache">; |
Bob Haarman | 69b196d | 2017-02-08 18:36:41 | [diff] [blame] | 80 | def lldsavetemps : F<"lldsavetemps">, |
Sam Clegg | 299b0e5 | 2021-01-18 19:39:28 | [diff] [blame] | 81 | HelpText<"Save intermediate LTO compilation results">; |
chrulski-intel | a9fe23c | 2024-03-20 15:02:43 | [diff] [blame] | 82 | def lto_sample_profile: P<"lto-sample-profile", "Sample profile file path">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 83 | def machine : P<"machine", "Specify target platform">; |
| 84 | def merge : P<"merge", "Combine sections">; |
| 85 | def mllvm : P<"mllvm", "Options to pass to LLVM">; |
| 86 | def nodefaultlib : P<"nodefaultlib", "Remove a default library">; |
| 87 | def opt : P<"opt", "Control optimizations">; |
Rui Ueyama | 57175aa | 2018-01-27 00:34:46 | [diff] [blame] | 88 | def order : P<"order", "Put functions in order">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 89 | def out : P<"out", "Path to file to write output">; |
Zachary Turner | f228276 | 2018-03-23 19:57:25 | [diff] [blame] | 90 | def natvis : P<"natvis", "Path to natvis file to embed in the PDB">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 91 | def pdb : P<"pdb", "PDB file path">; |
Peter Collingbourne | c8f5c05 | 2018-04-20 22:11:28 | [diff] [blame] | 92 | def pdbaltpath : P<"pdbaltpath", "PDB file path to embed in the image">; |
Nico Weber | f964ca8 | 2021-10-30 15:22:55 | [diff] [blame] | 93 | def pdbpagesize : P<"pdbpagesize", "PDB page size">; |
| 94 | def pdbstripped : P<"pdbstripped", "Stripped PDB file path">; |
Eric Astor | a39b14f | 2020-04-07 20:16:22 | [diff] [blame] | 95 | def pdbstream : Joined<["/", "-", "/?", "-?"], "pdbstream:">, |
| 96 | MetaVarName<"<name>=<file>">, |
| 97 | HelpText<"Embed the contents of <file> in the PDB as named stream <name>">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 98 | def section : P<"section", "Specify section attributes">; |
| 99 | def stack : P<"stack", "Size of the stack">; |
| 100 | def stub : P<"stub", "Specify DOS stub file">; |
| 101 | def subsystem : P<"subsystem", "Specify subsystem">; |
Zachary Turner | c8dd6cc | 2018-05-17 15:11:01 | [diff] [blame] | 102 | def timestamp : P<"timestamp", "Specify the PE header timestamp">; |
Peter Kasting | c5fb05f | 2022-02-16 14:20:03 | [diff] [blame] | 103 | def vctoolsdir : P<"vctoolsdir", "Set the location of the VC tools">; |
| 104 | def vctoolsversion : P<"vctoolsversion", |
| 105 | "Specify which VC tools version to use">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 106 | def version : P<"version", "Specify a version number in the PE header">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 107 | def wholearchive_file : P<"wholearchive", |
| 108 | "Include all object files from this library">; |
Peter Kasting | c5fb05f | 2022-02-16 14:20:03 | [diff] [blame] | 109 | def winsdkdir : P<"winsdkdir", "Set the location of the Windows SDK">; |
| 110 | def winsdkversion : P<"winsdkversion", "Specify which SDK version to use">; |
| 111 | def winsysroot : P<"winsysroot", |
| 112 | "Adds several subdirectories to the library search paths">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 113 | |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 114 | def disallowlib : Joined<["/", "-", "/?", "-?"], "disallowlib:">, |
| 115 | Alias<nodefaultlib>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 116 | |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 117 | def manifest : F<"manifest">, HelpText<"Create .manifest file">; |
| 118 | def manifest_colon : P< |
| 119 | "manifest", |
| 120 | "NO disables manifest output; EMBED[,ID=#] embeds manifest as resource in the image">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 121 | def manifestuac : P<"manifestuac", "User access control">; |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 122 | def manifestfile : P<"manifestfile", "Manifest output path, with /manifest">; |
| 123 | def manifestdependency : P< |
| 124 | "manifestdependency", |
| 125 | "Attributes for <dependency> element in manifest file; implies /manifest">; |
| 126 | def manifestinput : P< |
| 127 | "manifestinput", |
| 128 | "Additional manifest inputs; only valid with /manifest:embed">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 129 | |
| 130 | // We cannot use multiclass P because class name "incl" is different |
| 131 | // from its command line option name. We do this because "include" is |
| 132 | // a reserved keyword in tablegen. |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 133 | def incl : Joined<["/", "-", "/?", "-?"], "include:">, |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 134 | HelpText<"Force symbol to be added to symbol table as undefined one">; |
| 135 | |
| 136 | // "def" is also a keyword. |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 137 | def deffile : Joined<["/", "-", "/?", "-?"], "def:">, |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 138 | HelpText<"Use module-definition file">; |
| 139 | |
Reid Kleckner | 981576d | 2015-07-31 16:40:38 | [diff] [blame] | 140 | def debug : F<"debug">, HelpText<"Embed a symbol table in the image">; |
Will Wilson | 3cb1834 | 2018-09-24 15:28:03 | [diff] [blame] | 141 | def debug_opt : P<"debug", "Embed a symbol table in the image with option">; |
Saleem Abdulrasool | a2cca7e | 2016-08-08 22:02:44 | [diff] [blame] | 142 | def debugtype : P<"debugtype", "Debug Info Options">; |
Reid Kleckner | 981576d | 2015-07-31 16:40:38 | [diff] [blame] | 143 | def dll : F<"dll">, HelpText<"Create a DLL">; |
Rui Ueyama | f95ed69 | 2019-11-13 04:53:15 | [diff] [blame] | 144 | def driver : F<"driver">, HelpText<"Generate a Windows NT Kernel Mode Driver">; |
| 145 | def driver_wdm : F<"driver:wdm">, |
| 146 | HelpText<"Set IMAGE_FILE_UP_SYSTEM_ONLY bit in PE header">; |
| 147 | def driver_uponly : F<"driver:uponly">, |
| 148 | HelpText<"Set IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER bit in PE header">; |
| 149 | def driver_wdm_uponly : F<"driver:wdm,uponly">; |
| 150 | def driver_uponly_wdm : F<"driver:uponly,wdm">; |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 151 | def nodefaultlib_all : F<"nodefaultlib">, |
| 152 | HelpText<"Remove all default libraries">; |
| 153 | def noentry : F<"noentry">, |
| 154 | HelpText<"Don't add reference to DllMainCRTStartup; only valid with /dll">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 155 | def profile : F<"profile">; |
Nico Weber | 64fb85c | 2019-01-09 19:18:03 | [diff] [blame] | 156 | def repro : F<"Brepro">, |
| 157 | HelpText<"Use a hash of the executable as the PE header timestamp">; |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 158 | def reproduce : Joined<["/", "-", "/?", "-?"], "reproduce:">, |
| 159 | MetaVarName<"filename">, |
| 160 | HelpText<"Write tar file containing inputs and command to reproduce link">; |
Nico Weber | c0838af | 2019-04-25 14:02:26 | [diff] [blame] | 161 | def swaprun : P<"swaprun", |
| 162 | "Comma-separated list of 'cd' or 'net'">; |
| 163 | def swaprun_cd : F<"swaprun:cd">, Alias<swaprun>, AliasArgs<["cd"]>, |
| 164 | HelpText<"Make loader run output binary from swap instead of from CD">; |
| 165 | def swaprun_net : F<"swaprun:net">, Alias<swaprun>, AliasArgs<["net"]>, |
| 166 | HelpText<"Make loader run output binary from swap instead of from network">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 167 | def verbose : F<"verbose">; |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 168 | def wholearchive_flag : F<"wholearchive">, |
| 169 | HelpText<"Include all object files from all libraries">; |
Qfrost | 3f55853 | 2023-01-02 09:20:15 | [diff] [blame] | 170 | def release : F<"release">, |
| 171 | HelpText<"Set the Checksum in the header of an PE file">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 172 | |
| 173 | def force : F<"force">, |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 174 | HelpText<"Allow undefined and multiply defined symbols">; |
Rui Ueyama | 11ca38f | 2018-09-13 22:05:10 | [diff] [blame] | 175 | def force_unresolved : F<"force:unresolved">, |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 176 | HelpText<"Allow undefined symbols when creating executables">; |
Rui Ueyama | 11ca38f | 2018-09-13 22:05:10 | [diff] [blame] | 177 | def force_multiple : F<"force:multiple">, |
| 178 | HelpText<"Allow multiply defined symbols when creating executables">; |
Nico Weber | 81862f8 | 2019-05-02 21:21:55 | [diff] [blame] | 179 | def force_multipleres : F<"force:multipleres">, |
| 180 | HelpText<"Allow multiply defined resources when creating executables">; |
Nico Weber | 75196b9 | 2022-04-11 15:01:34 | [diff] [blame] | 181 | defm WX : B<"WX", "Treat warnings as errors", |
| 182 | "Don't treat warnings as errors (default)">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 183 | |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 184 | defm allowbind : B<"allowbind", "Enable DLL binding (default)", |
| 185 | "Disable DLL binding">; |
| 186 | defm allowisolation : B<"allowisolation", "Enable DLL isolation (default)", |
| 187 | "Disable DLL isolation">; |
Saleem Abdulrasool | 671029d | 2017-04-06 23:07:53 | [diff] [blame] | 188 | defm appcontainer : B<"appcontainer", |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 189 | "Image can only be run in an app container", |
| 190 | "Image can run outside an app container (default)">; |
Rui Ueyama | a2923b2 | 2020-03-13 10:41:18 | [diff] [blame] | 191 | defm cetcompat : B<"cetcompat", "Mark executable image as compatible with Control-flow Enforcement Technology (CET) Shadow Stack", |
| 192 | "Don't mark executable image as compatible with Control-flow Enforcement Technology (CET) Shadow Stack (default)">; |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 193 | defm dynamicbase : B<"dynamicbase", "Enable ASLR (default unless /fixed)", |
| 194 | "Disable ASLR (default when /fixed)">; |
| 195 | defm fixed : B<"fixed", "Disable base relocations", |
| 196 | "Enable base relocations (default)">; |
| 197 | defm highentropyva : B<"highentropyva", |
| 198 | "Enable 64-bit ASLR (default on 64-bit)", |
| 199 | "Disable 64-bit ASLR">; |
Bob Haarman | 5ec4485 | 2018-01-31 23:44:00 | [diff] [blame] | 200 | defm incremental : B<"incremental", |
| 201 | "Keep original import library if contents are unchanged", |
Nico Weber | d657c25 | 2018-05-31 13:43:02 | [diff] [blame] | 202 | "Overwrite import library even if contents are unchanged">; |
Alvin Wong | 8fa0cfe | 2023-04-23 15:58:24 | [diff] [blame] | 203 | defm inferasanlibs : B<"inferasanlibs", |
| 204 | "Unused, generates a warning", |
| 205 | "No effect (default)">; |
Nico Weber | d657c25 | 2018-05-31 13:43:02 | [diff] [blame] | 206 | defm integritycheck : B<"integritycheck", |
| 207 | "Set FORCE_INTEGRITY bit in PE header", |
| 208 | "No effect (default)">; |
Shoaib Meenai | 59bf362 | 2017-10-24 21:17:16 | [diff] [blame] | 209 | defm largeaddressaware : B<"largeaddressaware", |
| 210 | "Enable large addresses (default on 64-bit)", |
| 211 | "Disable large addresses (default on 32-bit)">; |
| 212 | defm nxcompat : B<"nxcompat", "Enable data execution prevention (default)", |
| 213 | "Disable data execution provention">; |
| 214 | defm safeseh : B<"safeseh", |
| 215 | "Produce an image with Safe Exception Handler (only for x86)", |
| 216 | "Don't produce an image with Safe Exception Handler">; |
| 217 | defm tsaware : B<"tsaware", |
| 218 | "Create Terminal Server aware executable (default)", |
| 219 | "Create non-Terminal Server aware executable">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 220 | |
| 221 | def help : F<"help">; |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 222 | |
| 223 | // /?? and -?? must be before /? and -? to not confuse lib/Options. |
| 224 | def help_q : Flag<["/??", "-??", "/?", "-?"], "">, Alias<help>; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 225 | |
Rui Ueyama | 9640173 | 2015-09-21 23:43:31 | [diff] [blame] | 226 | // LLD extensions |
Martin Storsjö | 7f0e6c3 | 2020-04-25 21:49:44 | [diff] [blame] | 227 | defm auto_import : B_priv<"auto-import">; |
| 228 | defm runtime_pseudo_reloc : B_priv<"runtime-pseudo-reloc">; |
Bob Haarman | 7dc5e7a0 | 2019-09-03 20:32:16 | [diff] [blame] | 229 | def end_lib : F<"end-lib">, |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 230 | HelpText<"End group of objects treated as if they were in a library">; |
Martin Storsjo | 272d8c1 | 2019-02-19 21:57:44 | [diff] [blame] | 231 | def exclude_all_symbols : F<"exclude-all-symbols">; |
Martin Storsjo | 7f71acd | 2017-10-12 05:37:13 | [diff] [blame] | 232 | def export_all_symbols : F<"export-all-symbols">; |
Nico Weber | 020d92c | 2019-03-11 23:02:18 | [diff] [blame] | 233 | defm demangle : B<"demangle", |
| 234 | "Demangle symbols in output (default)", |
| 235 | "Do not demangle symbols in output">; |
Martin Storsjo | c02f6bf | 2019-06-08 18:26:18 | [diff] [blame] | 236 | def include_optional : Joined<["/", "-", "/?", "-?"], "includeoptional:">, |
| 237 | HelpText<"Add symbol as undefined, but allow it to remain undefined">; |
Martin Storsjo | 5351891 | 2018-03-14 20:17:16 | [diff] [blame] | 238 | def kill_at : F<"kill-at">; |
Martin Storsjö | a67ae8c | 2023-10-20 20:44:44 | [diff] [blame] | 239 | defm lld_allow_duplicate_weak : B_priv<"lld-allow-duplicate-weak">; |
Matheus Izvekov | 3923e61 | 2023-10-02 20:54:43 | [diff] [blame] | 240 | def lldemit : P<"lldemit", "Specify output type">; |
Martin Storsjo | 31fe4cd | 2017-09-13 19:29:39 | [diff] [blame] | 241 | def lldmingw : F<"lldmingw">; |
Martin Storsjö | 745eb02 | 2020-07-27 20:44:41 | [diff] [blame] | 242 | def noseh : F<"noseh">; |
Martin Storsjö | 45c4c54 | 2020-10-03 22:29:45 | [diff] [blame] | 243 | def osversion : P_priv<"osversion">; |
Nico Weber | 4b81e9f | 2019-05-07 14:15:35 | [diff] [blame] | 244 | def output_def : Joined<["/", "-", "/?", "-?"], "output-def:">; |
Takuto Ikuta | d855928 | 2018-07-19 04:56:22 | [diff] [blame] | 245 | def pdb_source_path : P<"pdbsourcepath", |
Nico Weber | c7d8cc4 | 2019-09-14 23:41:42 | [diff] [blame] | 246 | "Base path used to make relative source file path absolute in PDB">; |
Nico Weber | a05cbb8 | 2017-09-05 23:46:45 | [diff] [blame] | 247 | def rsp_quoting : Joined<["--"], "rsp-quoting=">, |
| 248 | HelpText<"Quoting style for response files, 'windows' (default) or 'posix'">; |
Bob Haarman | 7dc5e7a0 | 2019-09-03 20:32:16 | [diff] [blame] | 249 | def start_lib : F<"start-lib">, |
Nico Weber | a0994cb | 2020-11-27 18:33:55 | [diff] [blame] | 250 | HelpText<"Start group of objects treated as if they were in a library">; |
Martin Storsjö | ce211c5 | 2021-06-17 18:51:37 | [diff] [blame] | 251 | defm stdcall_fixup : B_priv<"stdcall-fixup">; |
Bob Haarman | 63efb28 | 2019-07-11 18:03:14 | [diff] [blame] | 252 | def thinlto_emit_imports_files : |
| 253 | F<"thinlto-emit-imports-files">, |
| 254 | HelpText<"Emit .imports files with -thinlto-index-only">; |
| 255 | def thinlto_index_only : |
| 256 | F<"thinlto-index-only">, |
| 257 | HelpText<"Instead of linking, emit ThinLTO index files">; |
| 258 | def thinlto_index_only_arg : P< |
| 259 | "thinlto-index-only", |
| 260 | "-thinlto-index-only and also write native module names to file">; |
Bob Haarman | 5011b83 | 2019-07-11 18:48:58 | [diff] [blame] | 261 | def thinlto_object_suffix_replace : P< |
| 262 | "thinlto-object-suffix-replace", |
| 263 | "'old;new' replace old suffix with new suffix in ThinLTO index">; |
| 264 | def thinlto_prefix_replace: P< |
| 265 | "thinlto-prefix-replace", |
| 266 | "'old;new' replace old prefix with new prefix in ThinLTO outputs">; |
Bob Haarman | 5375b94 | 2019-08-21 18:24:59 | [diff] [blame] | 267 | def lto_obj_path : P< |
| 268 | "lto-obj-path", |
| 269 | "output native object for merged LTO unit to this path">; |
Yolanda Chen | 4f9c61e | 2021-03-25 02:55:18 | [diff] [blame] | 270 | def lto_cs_profile_generate: F<"lto-cs-profile-generate">, |
| 271 | HelpText<"Perform context sensitive PGO instrumentation">; |
| 272 | def lto_cs_profile_file : P<"lto-cs-profile-file", |
| 273 | "Context sensitive profile file path">; |
Yolanda Chen | 8fa16cc | 2021-08-11 16:45:55 | [diff] [blame] | 274 | defm lto_pgo_warn_mismatch: B< |
| 275 | "lto-pgo-warn-mismatch", |
| 276 | "turn on warnings about profile cfg mismatch (default)>", |
| 277 | "turn off warnings about profile cfg mismatch">; |
Rui Ueyama | a4cf97b | 2017-10-23 14:57:53 | [diff] [blame] | 278 | def dash_dash_version : Flag<["--"], "version">, |
Nico Weber | 77fb45e | 2020-12-22 20:51:20 | [diff] [blame] | 279 | HelpText<"Display the version number and exit">; |
Fangrui Song | eb4663d | 2020-03-17 19:40:19 | [diff] [blame] | 280 | def threads |
| 281 | : P<"threads", "Number of threads. '1' disables multi-threading. By " |
| 282 | "default all available hardware threads are used">; |
Zequan Wu | 763671f | 2020-07-21 20:46:11 | [diff] [blame] | 283 | def call_graph_ordering_file: P< |
Tobias Hieta | 2af4385 | 2022-04-12 11:59:45 | [diff] [blame] | 284 | "call-graph-ordering-file", |
Zequan Wu | 763671f | 2020-07-21 20:46:11 | [diff] [blame] | 285 | "Layout sections to optimize the given callgraph">; |
| 286 | defm call_graph_profile_sort: B< |
| 287 | "call-graph-profile-sort", |
| 288 | "Reorder sections with call graph profile (default)", |
| 289 | "Do not reorder sections with call graph profile">; |
| 290 | def print_symbol_order: P< |
| 291 | "print-symbol-order", |
| 292 | "Print a symbol order specified by /call-graph-ordering-file and " |
| 293 | "/call-graph-profile-sort into the specified file">; |
Martin Storsjö | 3785a41 | 2020-10-06 10:54:49 | [diff] [blame] | 294 | def wrap : P_priv<"wrap">; |
Rui Ueyama | 9640173 | 2015-09-21 23:43:31 | [diff] [blame] | 295 | |
Alex Brachet | fd9962e | 2022-07-11 21:31:01 | [diff] [blame] | 296 | def vfsoverlay : P<"vfsoverlay", "Path to a vfsoverlay yaml file to optionally look for /defaultlib's in">; |
| 297 | |
Reid Kleckner | 7aa6598 | 2024-07-23 22:11:17 | [diff] [blame] | 298 | def show_timing : F<"time">, |
| 299 | HelpText<"Print the time spent in each phase of linking">; |
Alexandre Ganea | 356139b | 2023-10-06 02:33:58 | [diff] [blame] | 300 | def time_trace_eq: Joined<["--"], "time-trace=">, MetaVarName<"<file>">, |
| 301 | HelpText<"Record time trace to <file>">; |
| 302 | def : Flag<["--"], "time-trace">, Alias<time_trace_eq>, |
| 303 | HelpText<"Record time trace to file next to output">; |
| 304 | |
| 305 | def time_trace_granularity_eq: Joined<["--"], "time-trace-granularity=">, |
| 306 | HelpText<"Minimum time granularity (in microseconds) traced by time profiler">; |
| 307 | |
Zequan Wu | aaf3a8d | 2023-12-05 19:57:45 | [diff] [blame] | 308 | defm build_id: B< |
| 309 | "build-id", |
| 310 | "Generate build ID (always on when generating PDB)", |
| 311 | "Do not Generate build ID">; |
| 312 | |
Peter Collingbourne | be54955 | 2015-06-26 18:58:24 | [diff] [blame] | 313 | // Flags for debugging |
Hans Wennborg | 1818e65 | 2016-12-09 20:54:44 | [diff] [blame] | 314 | def lldmap : F<"lldmap">; |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 315 | def lldmap_file : P_priv<"lldmap">; |
Sylvain Audi | b91905a | 2020-03-23 21:06:48 | [diff] [blame] | 316 | def map : F<"map">; |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 317 | def map_file : P_priv<"map">; |
Pengxuan Zheng | 7b31756 | 2022-09-20 00:21:21 | [diff] [blame] | 318 | def map_info : P<"mapinfo", "Include the specified information in a map file">; |
Tobias Hieta | 33f9342 | 2023-07-12 07:22:06 | [diff] [blame] | 319 | def print_search_paths : F<"print-search-paths">; |
Alexandre Ganea | 3e60ee9 | 2019-03-14 18:45:08 | [diff] [blame] | 320 | def summary : F<"summary">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 321 | |
| 322 | //============================================================================== |
| 323 | // The flags below do nothing. They are defined only for link.exe compatibility. |
| 324 | //============================================================================== |
| 325 | |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 326 | def ignoreidl : F<"ignoreidl">; |
Nico Weber | 34ac7a7 | 2021-08-27 02:03:26 | [diff] [blame] | 327 | def ltcg : F<"ltcg">; |
oberrich | 7f9c264 | 2022-10-03 13:03:14 | [diff] [blame] | 328 | def assemblydebug : F<"assemblydebug">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 329 | def nologo : F<"nologo">; |
Rui Ueyama | 43238317 | 2015-07-29 21:01:15 | [diff] [blame] | 330 | def throwingnew : F<"throwingnew">; |
Rui Ueyama | 3c4737d | 2015-08-11 16:46:08 | [diff] [blame] | 331 | def editandcontinue : F<"editandcontinue">; |
Reid Kleckner | 9cd77ce | 2016-03-25 18:09:29 | [diff] [blame] | 332 | def fastfail : F<"fastfail">; |
Pengxuan Zheng | b5e49cd | 2022-06-21 01:44:32 | [diff] [blame] | 333 | def kernel : F<"kernel">; |
Pengxuan Zheng | dec1614 | 2022-06-20 22:14:44 | [diff] [blame] | 334 | def pdbcompress : F<"pdbcompress">; |
oberrich | 7f9c264 | 2022-10-03 13:03:14 | [diff] [blame] | 335 | def emitpogophaseinfo : F<"emitpogophaseinfo">; |
Rui Ueyama | 411c6360 | 2015-05-28 19:09:30 | [diff] [blame] | 336 | |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 337 | def delay : P_priv<"delay">; |
| 338 | def errorreport : P_priv<"errorreport">; |
| 339 | def idlout : P_priv<"idlout">; |
Nico Weber | 34ac7a7 | 2021-08-27 02:03:26 | [diff] [blame] | 340 | def ilk : P_priv<"ilk">; |
| 341 | def ltcg_opt : P_priv<"ltcg">; |
oberrich | 7f9c264 | 2022-10-03 13:03:14 | [diff] [blame] | 342 | def assemblydebug_opt : P_priv<"assemblydebug">; |
Nico Weber | 34ac7a7 | 2021-08-27 02:03:26 | [diff] [blame] | 343 | def ltcgout : P_priv<"ltcgout">; |
Nico Weber | 66dc44f | 2021-08-27 02:01:00 | [diff] [blame] | 344 | def maxilksize : P_priv<"maxilksize">; |
| 345 | def tlbid : P_priv<"tlbid">; |
| 346 | def tlbout : P_priv<"tlbout">; |
| 347 | def verbose_all : P_priv<"verbose">; |
| 348 | def guardsym : P_priv<"guardsym">; |