Commit d69ac8b7 by Roman Geissler Committed by Jeff Law

collect2.c (linker_select): Add USE_LLD_LD.

	* collect2.c (linker_select):  Add USE_LLD_LD.
	(ld_suffixes): Add ld.lld.
	(main): Handle -fuse-ld=lld.
	* common.opt (-fuse-ld=lld): New option.
	* doc/invoke.texi (-fuse-ld=lld): Document.
	* opts.c (common_handle_option): Handle OPT_fuse_ld_lld.

From-SVN: r265940
parent d28441a7
...@@ -4,6 +4,15 @@ ...@@ -4,6 +4,15 @@
* doc/invoke.texi (Optimize Options): Clarify default behavior * doc/invoke.texi (Optimize Options): Clarify default behavior
for -fno-sched-interblock and -fno-sched-spec. for -fno-sched-interblock and -fno-sched-spec.
2018-11-08 Roman Geissler <roman.geissler@amadeus.com>
* collect2.c (linker_select): Add USE_LLD_LD.
(ld_suffixes): Add ld.lld.
(main): Handle -fuse-ld=lld.
* common.opt (-fuse-ld=lld): New option.
* doc/invoke.texi (-fuse-ld=lld): Document.
* opts.c (common_handle_option): Handle OPT_fuse_ld_lld.
2018-11-08 Paul Koning <ni1d@arrl.net> 2018-11-08 Paul Koning <ni1d@arrl.net>
* config/pdp11/constraints.md: Add "Z" series constraints for use * config/pdp11/constraints.md: Add "Z" series constraints for use
...@@ -831,6 +831,7 @@ main (int argc, char **argv) ...@@ -831,6 +831,7 @@ main (int argc, char **argv)
USE_PLUGIN_LD, USE_PLUGIN_LD,
USE_GOLD_LD, USE_GOLD_LD,
USE_BFD_LD, USE_BFD_LD,
USE_LLD_LD,
USE_LD_MAX USE_LD_MAX
} selected_linker = USE_DEFAULT_LD; } selected_linker = USE_DEFAULT_LD;
static const char *const ld_suffixes[USE_LD_MAX] = static const char *const ld_suffixes[USE_LD_MAX] =
...@@ -838,7 +839,8 @@ main (int argc, char **argv) ...@@ -838,7 +839,8 @@ main (int argc, char **argv)
"ld", "ld",
PLUGIN_LD_SUFFIX, PLUGIN_LD_SUFFIX,
"ld.gold", "ld.gold",
"ld.bfd" "ld.bfd",
"ld.lld"
}; };
static const char *const real_ld_suffix = "real-ld"; static const char *const real_ld_suffix = "real-ld";
static const char *const collect_ld_suffix = "collect-ld"; static const char *const collect_ld_suffix = "collect-ld";
...@@ -1007,6 +1009,8 @@ main (int argc, char **argv) ...@@ -1007,6 +1009,8 @@ main (int argc, char **argv)
selected_linker = USE_BFD_LD; selected_linker = USE_BFD_LD;
else if (strcmp (argv[i], "-fuse-ld=gold") == 0) else if (strcmp (argv[i], "-fuse-ld=gold") == 0)
selected_linker = USE_GOLD_LD; selected_linker = USE_GOLD_LD;
else if (strcmp (argv[i], "-fuse-ld=lld") == 0)
selected_linker = USE_LLD_LD;
#ifdef COLLECT_EXPORT_LIST #ifdef COLLECT_EXPORT_LIST
/* These flags are position independent, although their order /* These flags are position independent, although their order
...@@ -1096,7 +1100,8 @@ main (int argc, char **argv) ...@@ -1096,7 +1100,8 @@ main (int argc, char **argv)
/* Maybe we know the right file to use (if not cross). */ /* Maybe we know the right file to use (if not cross). */
ld_file_name = 0; ld_file_name = 0;
#ifdef DEFAULT_LINKER #ifdef DEFAULT_LINKER
if (selected_linker == USE_BFD_LD || selected_linker == USE_GOLD_LD) if (selected_linker == USE_BFD_LD || selected_linker == USE_GOLD_LD ||
selected_linker == USE_LLD_LD)
{ {
char *linker_name; char *linker_name;
# ifdef HOST_EXECUTABLE_SUFFIX # ifdef HOST_EXECUTABLE_SUFFIX
...@@ -1315,7 +1320,7 @@ main (int argc, char **argv) ...@@ -1315,7 +1320,7 @@ main (int argc, char **argv)
else if (!use_collect_ld else if (!use_collect_ld
&& strncmp (arg, "-fuse-ld=", 9) == 0) && strncmp (arg, "-fuse-ld=", 9) == 0)
{ {
/* Do not pass -fuse-ld={bfd|gold} to the linker. */ /* Do not pass -fuse-ld={bfd|gold|lld} to the linker. */
ld1--; ld1--;
ld2--; ld2--;
} }
......
...@@ -2732,6 +2732,10 @@ fuse-ld=gold ...@@ -2732,6 +2732,10 @@ fuse-ld=gold
Common Driver Negative(fuse-ld=bfd) Common Driver Negative(fuse-ld=bfd)
Use the gold linker instead of the default linker. Use the gold linker instead of the default linker.
fuse-ld=lld
Common Driver Negative(fuse-ld=lld)
Use the lld LLVM linker instead of the default linker.
fuse-linker-plugin fuse-linker-plugin
Common Undocumented Var(flag_use_linker_plugin) Common Undocumented Var(flag_use_linker_plugin)
......
...@@ -12610,6 +12610,10 @@ Use the @command{bfd} linker instead of the default linker. ...@@ -12610,6 +12610,10 @@ Use the @command{bfd} linker instead of the default linker.
@opindex fuse-ld=gold @opindex fuse-ld=gold
Use the @command{gold} linker instead of the default linker. Use the @command{gold} linker instead of the default linker.
@item -fuse-ld=lld
@opindex fuse-ld=lld
Use the LLVM @command{lld} linker instead of the default linker.
@cindex Libraries @cindex Libraries
@item -l@var{library} @item -l@var{library}
@itemx -l @var{library} @itemx -l @var{library}
...@@ -2557,6 +2557,7 @@ common_handle_option (struct gcc_options *opts, ...@@ -2557,6 +2557,7 @@ common_handle_option (struct gcc_options *opts,
case OPT_fuse_ld_bfd: case OPT_fuse_ld_bfd:
case OPT_fuse_ld_gold: case OPT_fuse_ld_gold:
case OPT_fuse_ld_lld:
case OPT_fuse_linker_plugin: case OPT_fuse_linker_plugin:
/* No-op. Used by the driver and passed to us because it starts with f.*/ /* No-op. Used by the driver and passed to us because it starts with f.*/
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment