summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-08 01:37:00 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-08 01:37:00 +0000
commitde4d280bb3834f8631dfb3e05056adc0322246d1 (patch)
tree6f419805e71a133ecdcbe5137da91c38f6dab263 /gcc/gcc.c
parent050b8e21725dc9d70d98e540875009d15e821a4e (diff)
downloadgcc-de4d280bb3834f8631dfb3e05056adc0322246d1.tar.gz
* Makefile.in: Regenerate.
* Makefile.def (gcc host module) and soft dependency on lto-plugin and configure dependency on lto-plugin configure. (lto-plugin module): Remove dependency on GCC; add dependency on liniberty. * doc/invoke.texi: (-flto, -fuse-linker-plugin): Update defaults and no longer claim that gold is required for linker plugin. * configure: Regenerate. * gcc.c (PLUGIN_COND): New macro. (LINK_COMMAND_SPEC): Use it. (main): Default to plugin enabled with HAVE_LTO_PLUGIN is set. * config.in (HAVE_LTO_PLUGIN): New. * configure.ac (--with-lto-plugin): New parameter; autodetect HAVE_LTO_PLUGIN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168593 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 2aebceffd57..9532d7efd8b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -621,6 +621,13 @@ proper position among the other output files. */
# endif
#endif
+/* Conditional to test whether plugin is used or not. */
+#ifdef HAVE_LTO_PLUGIN
+#define PLUGIN_COND "!fno-use-linker-plugin"
+#else
+#define PLUGIN_COND "fuse-linker-plugin"
+#endif
+
/* -u* was put back because both BSD and SysV seem to support it. */
/* %{static:} simply prevents an error message if the target machine
@@ -634,7 +641,7 @@ proper position among the other output files. */
#define LINK_COMMAND_SPEC "\
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker) \
- %{fuse-linker-plugin: \
+ %{"PLUGIN_COND": \
-plugin %(linker_plugin_file) \
-plugin-opt=%(lto_wrapper) \
-plugin-opt=-fresolution=%u.res \
@@ -6779,7 +6786,11 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (num_linker_inputs > 0 && !seen_error () && print_subprocess_help < 2)
{
int tmp = execution_count;
+#ifdef HAVE_LTO_PLUGIN
+ const char *fno_use_linker_plugin = "fno-use-linker-plugin";
+#else
const char *fuse_linker_plugin = "fuse-linker-plugin";
+#endif
/* We'll use ld if we can't find collect2. */
if (! strcmp (linker_name_spec, "collect2"))
@@ -6789,8 +6800,13 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
linker_name_spec = "ld";
}
+#ifdef HAVE_LTO_PLUGIN
+ if (!switch_matches (fno_use_linker_plugin,
+ fno_use_linker_plugin + strlen (fno_use_linker_plugin), 0))
+#else
if (switch_matches (fuse_linker_plugin,
fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
+#endif
{
linker_plugin_file_spec = find_a_file (&exec_prefixes,
LTOPLUGINSONAME, R_OK,