diff options
author | Richard Biener <rguenther@suse.de> | 2014-03-06 08:48:01 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-03-06 08:48:01 +0000 |
commit | f3ba16d0589db7548b76f381102759f2c4cc7558 (patch) | |
tree | fa7f9924d2c5057881344899e74b9fd4ecc3993d /gcc/collect2.c | |
parent | df2b279c5c77f5925e85246f3dbdad92508c573b (diff) | |
download | gcc-f3ba16d0589db7548b76f381102759f2c4cc7558.zip gcc-f3ba16d0589db7548b76f381102759f2c4cc7558.tar.gz gcc-f3ba16d0589db7548b76f381102759f2c4cc7558.tar.bz2 |
gcc.c (PLUGIN_COND): Always enable unless -fno-use-linker-plugin or -fno-lto is specified and the...
2014-03-06 Richard Biener <rguenther@suse.de>
* gcc.c (PLUGIN_COND): Always enable unless -fno-use-linker-plugin
or -fno-lto is specified and the linker has full plugin support.
* collect2.c (lto_mode): Default to LTO_MODE_WHOPR if LTO is
enabled.
(main): Remove -flto processing, adjust lto_mode using
use_plugin late.
* lto-wrapper.c (merge_and_complain): Merge compile-time
optimization levels.
(run_gcc): And pass it through to the link options.
From-SVN: r208375
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r-- | gcc/collect2.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c index 38d3421..f0ab6b8 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -192,7 +192,11 @@ enum lto_mode_d { }; /* Current LTO mode. */ +#ifdef ENABLE_LTO +static enum lto_mode_d lto_mode = LTO_MODE_WHOPR; +#else static enum lto_mode_d lto_mode = LTO_MODE_NONE; +#endif bool debug; /* true if -debug */ bool helpflag; /* true if --help */ @@ -1018,15 +1022,11 @@ main (int argc, char **argv) debug = true; else if (! strcmp (argv[i], "-flto-partition=none")) no_partition = true; - else if ((! strncmp (argv[i], "-flto=", 6) - || ! strcmp (argv[i], "-flto")) && ! use_plugin) - lto_mode = LTO_MODE_WHOPR; else if (!strncmp (argv[i], "-fno-lto", 8)) lto_mode = LTO_MODE_NONE; else if (! strcmp (argv[i], "-plugin")) { use_plugin = true; - lto_mode = LTO_MODE_NONE; if (selected_linker == USE_DEFAULT_LD) selected_linker = USE_PLUGIN_LD; } @@ -1056,6 +1056,8 @@ main (int argc, char **argv) } vflag = debug; find_file_set_debug (debug); + if (use_plugin) + lto_mode = LTO_MODE_NONE; if (no_partition && lto_mode == LTO_MODE_WHOPR) lto_mode = LTO_MODE_LTO; } |