2015-05-29 03:09:30 +08:00
|
|
|
include "llvm/Option/OptParser.td"
|
|
|
|
|
|
|
|
// link.exe accepts options starting with either a dash or a slash.
|
|
|
|
|
|
|
|
// Flag that takes no arguments.
|
|
|
|
class F<string name> : Flag<["/", "-", "-?"], name>;
|
|
|
|
|
|
|
|
// Flag that takes one argument after ":".
|
|
|
|
class P<string name, string help> :
|
|
|
|
Joined<["/", "-", "-?"], name#":">, HelpText<help>;
|
|
|
|
|
|
|
|
// Boolean flag suffixed by ":no".
|
|
|
|
multiclass B<string name, string help> {
|
|
|
|
def "" : F<name>;
|
|
|
|
def _no : F<name#":no">, HelpText<help>;
|
|
|
|
}
|
|
|
|
|
|
|
|
def align : P<"align", "Section alignment">;
|
|
|
|
def alternatename : P<"alternatename", "Define weak alias">;
|
|
|
|
def base : P<"base", "Base address of the program">;
|
|
|
|
def defaultlib : P<"defaultlib", "Add the library to the list of input files">;
|
|
|
|
def delayload : P<"delayload", "Delay loaded DLL name">;
|
|
|
|
def entry : P<"entry", "Name of entry point symbol">;
|
|
|
|
def export : P<"export", "Export a function">;
|
|
|
|
// No help text because /failifmismatch is not intended to be used by the user.
|
|
|
|
def failifmismatch : P<"failifmismatch", "">;
|
|
|
|
def heap : P<"heap", "Size of the heap">;
|
|
|
|
def implib : P<"implib", "Import library name">;
|
|
|
|
def libpath : P<"libpath", "Additional library search path">;
|
2016-07-26 10:00:42 +08:00
|
|
|
def linkrepro : P<"linkrepro", "Dump linker invocation and input files for debugging">;
|
2017-02-09 02:36:41 +08:00
|
|
|
def lldsavetemps : F<"lldsavetemps">,
|
|
|
|
HelpText<"Save temporary files instead of deleting them">;
|
2015-05-29 03:09:30 +08:00
|
|
|
def machine : P<"machine", "Specify target platform">;
|
|
|
|
def merge : P<"merge", "Combine sections">;
|
|
|
|
def mllvm : P<"mllvm", "Options to pass to LLVM">;
|
|
|
|
def nodefaultlib : P<"nodefaultlib", "Remove a default library">;
|
|
|
|
def opt : P<"opt", "Control optimizations">;
|
|
|
|
def out : P<"out", "Path to file to write output">;
|
|
|
|
def pdb : P<"pdb", "PDB file path">;
|
|
|
|
def section : P<"section", "Specify section attributes">;
|
|
|
|
def stack : P<"stack", "Size of the stack">;
|
|
|
|
def stub : P<"stub", "Specify DOS stub file">;
|
|
|
|
def subsystem : P<"subsystem", "Specify subsystem">;
|
|
|
|
def version : P<"version", "Specify a version number in the PE header">;
|
|
|
|
|
|
|
|
def disallowlib : Joined<["/", "-", "-?"], "disallowlib:">, Alias<nodefaultlib>;
|
|
|
|
|
|
|
|
def manifest : F<"manifest">;
|
|
|
|
def manifest_colon : P<"manifest", "Create manifest file">;
|
|
|
|
def manifestuac : P<"manifestuac", "User access control">;
|
|
|
|
def manifestfile : P<"manifestfile", "Manifest file path">;
|
|
|
|
def manifestdependency : P<"manifestdependency",
|
|
|
|
"Attributes for <dependency> in manifest file">;
|
2016-04-19 09:21:58 +08:00
|
|
|
def manifestinput : P<"manifestinput", "Specify manifest file">;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
// We cannot use multiclass P because class name "incl" is different
|
|
|
|
// from its command line option name. We do this because "include" is
|
|
|
|
// a reserved keyword in tablegen.
|
|
|
|
def incl : Joined<["/", "-"], "include:">,
|
|
|
|
HelpText<"Force symbol to be added to symbol table as undefined one">;
|
|
|
|
|
|
|
|
// "def" is also a keyword.
|
|
|
|
def deffile : Joined<["/", "-"], "def:">,
|
|
|
|
HelpText<"Use module-definition file">;
|
|
|
|
|
2015-08-01 00:40:38 +08:00
|
|
|
def debug : F<"debug">, HelpText<"Embed a symbol table in the image">;
|
2016-08-09 06:02:44 +08:00
|
|
|
def debugtype : P<"debugtype", "Debug Info Options">;
|
2015-08-01 00:40:38 +08:00
|
|
|
def dll : F<"dll">, HelpText<"Create a DLL">;
|
2016-08-09 06:02:44 +08:00
|
|
|
def driver : P<"driver", "Generate a Windows NT Kernel Mode Driver">;
|
2015-05-29 03:09:30 +08:00
|
|
|
def nodefaultlib_all : F<"nodefaultlib">;
|
|
|
|
def noentry : F<"noentry">;
|
|
|
|
def profile : F<"profile">;
|
|
|
|
def swaprun_cd : F<"swaprun:cd">;
|
|
|
|
def swaprun_net : F<"swaprun:net">;
|
|
|
|
def verbose : F<"verbose">;
|
|
|
|
|
|
|
|
def force : F<"force">,
|
|
|
|
HelpText<"Allow undefined symbols when creating executables">;
|
|
|
|
def force_unresolved : F<"force:unresolved">;
|
|
|
|
|
|
|
|
defm allowbind: B<"allowbind", "Disable DLL binding">;
|
|
|
|
defm allowisolation : B<"allowisolation", "Set NO_ISOLATION bit">;
|
|
|
|
defm dynamicbase : B<"dynamicbase",
|
|
|
|
"Disable address space layout randomization">;
|
|
|
|
defm fixed : B<"fixed", "Enable base relocations">;
|
|
|
|
defm highentropyva : B<"highentropyva", "Set HIGH_ENTROPY_VA bit">;
|
|
|
|
defm largeaddressaware : B<"largeaddressaware", "Disable large addresses">;
|
|
|
|
defm nxcompat : B<"nxcompat", "Disable data execution provention">;
|
|
|
|
defm safeseh : B<"safeseh", "Produce an image with Safe Exception Handler">;
|
|
|
|
defm tsaware : B<"tsaware", "Create non-Terminal Server aware executable">;
|
|
|
|
|
|
|
|
def help : F<"help">;
|
|
|
|
def help_q : Flag<["/?", "-?"], "">, Alias<help>;
|
|
|
|
|
2015-09-22 07:43:31 +08:00
|
|
|
// LLD extensions
|
2017-03-23 03:49:12 +08:00
|
|
|
def nopdb : F<"nopdb">, HelpText<"Disable PDB generation for DWARF users">;
|
2015-09-22 07:43:31 +08:00
|
|
|
def nosymtab : F<"nosymtab">;
|
2017-02-07 04:47:55 +08:00
|
|
|
def msvclto : F<"msvclto">;
|
2015-09-22 07:43:31 +08:00
|
|
|
|
2015-06-27 02:58:24 +08:00
|
|
|
// Flags for debugging
|
2016-12-11 01:23:23 +08:00
|
|
|
def debugpdb : F<"debugpdb">;
|
2016-11-22 01:22:35 +08:00
|
|
|
def dumppdb : Joined<["/", "-"], "dumppdb">;
|
2016-12-10 04:54:44 +08:00
|
|
|
def lldmap : F<"lldmap">;
|
|
|
|
def lldmap_file : Joined<["/", "-"], "lldmap:">;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
// The flags below do nothing. They are defined only for link.exe compatibility.
|
|
|
|
//==============================================================================
|
|
|
|
|
|
|
|
class QF<string name> : Joined<["/", "-", "-?"], name#":">;
|
|
|
|
|
|
|
|
multiclass QB<string name> {
|
|
|
|
def "" : F<name>;
|
|
|
|
def _no : F<name#":no">;
|
|
|
|
}
|
|
|
|
|
|
|
|
def functionpadmin : F<"functionpadmin">;
|
|
|
|
def ignoreidl : F<"ignoreidl">;
|
|
|
|
def incremental : F<"incremental">;
|
|
|
|
def no_incremental : F<"incremental:no">;
|
|
|
|
def nologo : F<"nologo">;
|
2015-07-30 05:01:15 +08:00
|
|
|
def throwingnew : F<"throwingnew">;
|
2015-08-12 00:46:08 +08:00
|
|
|
def editandcontinue : F<"editandcontinue">;
|
2016-03-26 02:09:29 +08:00
|
|
|
def fastfail : F<"fastfail">;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
def delay : QF<"delay">;
|
|
|
|
def errorreport : QF<"errorreport">;
|
|
|
|
def idlout : QF<"idlout">;
|
|
|
|
def ignore : QF<"ignore">;
|
|
|
|
def maxilksize : QF<"maxilksize">;
|
|
|
|
def pdbaltpath : QF<"pdbaltpath">;
|
|
|
|
def tlbid : QF<"tlbid">;
|
|
|
|
def tlbout : QF<"tlbout">;
|
|
|
|
def verbose_all : QF<"verbose">;
|
2015-09-04 00:20:47 +08:00
|
|
|
def guardsym : QF<"guardsym">;
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
defm wx : QB<"wx">;
|