aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-01-08 02:37:00 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2011-01-08 01:37:00 +0000
commit96bdf9b4035f9628ee214b9d773c313b065e36bf (patch)
tree6f419805e71a133ecdcbe5137da91c38f6dab263 /gcc/gcc.c
parentf35cafc9ff3898a2205a2089f315f19640da1041 (diff)
downloadgcc-96bdf9b4035f9628ee214b9d773c313b065e36bf.zip
gcc-96bdf9b4035f9628ee214b9d773c313b065e36bf.tar.gz
gcc-96bdf9b4035f9628ee214b9d773c313b065e36bf.tar.bz2
Makefile.in: Regenerate.
* 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. From-SVN: r168593
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 2aebcef..9532d7e 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,