2012-12-08 08:47:36 +08:00
|
|
|
include "llvm/Option/OptParser.td"
|
|
|
|
|
2013-04-05 02:59:24 +08:00
|
|
|
def target : Separate<["-"], "target">,
|
|
|
|
MetaVarName<"<triple>">,
|
|
|
|
HelpText<"Target triple to link for">;
|
|
|
|
|
2013-08-26 09:56:27 +08:00
|
|
|
def mllvm : Separate<["-"], "mllvm">,
|
|
|
|
HelpText<"Options to pass to LLVM">;
|
2013-01-09 06:59:27 +08:00
|
|
|
|
2013-08-26 02:05:15 +08:00
|
|
|
// Single and multiple dash options combined
|
|
|
|
multiclass smDash<string opt1, string opt2, string help> {
|
|
|
|
def "" : Separate<["-"], opt1>, HelpText<help>;
|
2013-08-26 09:56:27 +08:00
|
|
|
def opt1_eq : Separate<["-"], opt1#"=">,
|
|
|
|
Alias<!cast<Option>(opt1)>;
|
|
|
|
def opt2_dashdash : Separate<["--"], opt2>,
|
|
|
|
Alias<!cast<Option>(opt1)>;
|
|
|
|
def opt2_dashdash_eq : Separate<["--"], opt2#"=">,
|
|
|
|
Alias<!cast<Option>(opt1)>;
|
2013-08-26 02:05:15 +08:00
|
|
|
}
|
2012-12-08 08:47:36 +08:00
|
|
|
|
2013-08-26 02:05:15 +08:00
|
|
|
defm e : smDash<"e", "entry",
|
|
|
|
"Name of entry point symbol">;
|
2012-12-08 08:47:36 +08:00
|
|
|
|
2013-04-05 02:59:24 +08:00
|
|
|
def output : Separate<["-"], "o">,
|
|
|
|
MetaVarName<"<path>">,
|
|
|
|
HelpText<"Path to file to write output">;
|
|
|
|
|
2012-12-08 08:47:36 +08:00
|
|
|
def relocatable : Flag<["--"], "relocatable">;
|
|
|
|
def relocatable_r : Flag<["-"], "r">, Alias<relocatable>;
|
2012-12-10 07:56:26 +08:00
|
|
|
|
2013-05-30 06:51:01 +08:00
|
|
|
def dynamic_linker : Joined<["--"], "dynamic-linker=">,
|
|
|
|
HelpText<"Set the path to the dynamic linker">;
|
2013-08-26 09:56:27 +08:00
|
|
|
def dynamic_linker_alias : Separate<["-"], "dynamic-linker">,
|
|
|
|
Alias<dynamic_linker>;
|
2013-01-08 10:12:01 +08:00
|
|
|
|
|
|
|
def m : Separate<["-"], "m">;
|
2013-02-07 14:47:17 +08:00
|
|
|
def z : Separate<["-"], "z">;
|
2013-04-05 02:59:24 +08:00
|
|
|
def t : Flag<["-"], "t">;
|
2013-03-09 09:41:37 +08:00
|
|
|
def rpath : Separate<["-"], "rpath">;
|
|
|
|
def soname : Separate<["-"], "soname">;
|
2013-01-08 10:12:01 +08:00
|
|
|
|
|
|
|
def static : Flag<["-"], "static">;
|
2013-03-09 09:41:37 +08:00
|
|
|
def shared : Flag<["-"], "shared">;
|
2013-02-07 14:47:17 +08:00
|
|
|
def start_group : Flag<["--"], "start-group">;
|
|
|
|
def end_group : Flag<["--"], "end-group">;
|
|
|
|
def build_id : Flag<["--"], "build-id">;
|
2013-03-09 09:41:37 +08:00
|
|
|
def eh_frame_hdr : Flag<["--"], "eh-frame-hdr">;
|
2013-01-08 10:12:01 +08:00
|
|
|
|
2013-04-05 02:59:24 +08:00
|
|
|
def help : Flag<["--"], "help">;
|
|
|
|
|
|
|
|
def L : Joined<["-"], "L">,
|
|
|
|
MetaVarName<"<dir>">,
|
|
|
|
HelpText<"Directory to search for libraries">;
|
|
|
|
def l : Joined<["-"], "l">,
|
|
|
|
MetaVarName<"<libName>">,
|
|
|
|
HelpText<"Root name of library to use">;
|
2013-02-07 14:47:17 +08:00
|
|
|
def hash_style : Joined <["--"], "hash-style=">;
|
2013-01-11 23:11:47 +08:00
|
|
|
|
|
|
|
def noinhibit_exec : Flag<["--"], "noinhibit-exec">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"Retain the executable output file whenever"
|
|
|
|
" it is still usable">;
|
2013-02-13 14:12:52 +08:00
|
|
|
|
2013-04-05 02:59:24 +08:00
|
|
|
def merge_strings : Flag<["--"], "merge-strings">,
|
2013-02-13 14:12:52 +08:00
|
|
|
HelpText<"Merge common strings across mergeable sections">;
|
2013-04-05 02:59:24 +08:00
|
|
|
|
|
|
|
|
2013-04-11 10:56:30 +08:00
|
|
|
def no_allow_shlib_undefs : Flag<["--"], "no-allow-shlib-undefined">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"Donot allow undefined symbols from dynamic"
|
|
|
|
" library when creating executables">;
|
2013-04-11 10:56:30 +08:00
|
|
|
|
|
|
|
def allow_shlib_undefs : Flag<["--"], "allow-shlib-undefined">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"Allow undefined symbols from dynamic"
|
|
|
|
" library when creating executables">;
|
2013-04-11 10:56:30 +08:00
|
|
|
|
|
|
|
def use_shlib_undefs: Flag<["--"], "use-shlib-undefines">,
|
|
|
|
HelpText<"Resolve undefined symbols from dynamic libraries">;
|
|
|
|
|
2013-06-16 13:06:28 +08:00
|
|
|
def nmagic : Flag<["--"], "nmagic">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"Turn off page alignment of sections,"
|
|
|
|
" and disable linking against shared libraries">;
|
2013-06-16 13:06:28 +08:00
|
|
|
def nmagic_alias : Flag<["-"], "n">, Alias<nmagic>;
|
|
|
|
|
|
|
|
def omagic : Flag<["--"], "omagic">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"Set the text and data sections to be readable and writable."
|
|
|
|
" Also, do not page-align the data segment, and"
|
|
|
|
" disable linking against shared libraries.">;
|
|
|
|
|
2013-06-16 13:06:28 +08:00
|
|
|
def omagic_alias : Flag<["-"], "N">, Alias<omagic>;
|
|
|
|
|
|
|
|
def no_omagic : Flag<["--"], "no-omagic">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"This option negates most of the effects of the -N option."
|
|
|
|
"Disable linking with shared libraries">;
|
2013-06-16 13:06:28 +08:00
|
|
|
|
2013-08-26 02:05:15 +08:00
|
|
|
defm u : smDash<"u", "undefined",
|
2013-08-26 09:56:27 +08:00
|
|
|
"Force symbol to be entered in the output file"
|
|
|
|
" as an undefined symbol">;
|
2013-06-19 08:31:09 +08:00
|
|
|
|
2013-08-22 06:57:10 +08:00
|
|
|
def as_needed : Flag<["--"], "as-needed">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"This option affects ELF DT_NEEDED tags for "
|
|
|
|
"dynamic libraries mentioned on the command line">;
|
2013-08-22 06:57:10 +08:00
|
|
|
def no_as_needed : Flag<["--"], "no-as-needed">,
|
2013-08-26 09:56:27 +08:00
|
|
|
HelpText<"This option restores the default behavior"
|
|
|
|
" of adding DT_NEEDED entries">;
|
2013-08-22 06:57:10 +08:00
|
|
|
|
2013-04-05 02:59:24 +08:00
|
|
|
// extensions
|
|
|
|
def emit_yaml : Flag<["-"], "emit-yaml">,
|
|
|
|
HelpText<"Write YAML instead of ELF">;
|
2013-08-22 06:57:10 +08:00
|
|
|
def whole_archive: Flag<["--"], "whole-archive">,
|
|
|
|
HelpText<"Force load of all members in a static library">;
|
|
|
|
def no_whole_archive: Flag<["--"], "no-whole-archive">,
|
|
|
|
HelpText<"Restores the default behavior of loading archive members">;
|
|
|
|
|
|
|
|
def all_load : Flag<["-"], "all_load">,
|
|
|
|
HelpText<"Forces all members of all static libraries to be loaded">;
|