aboutsummaryrefslogtreecommitdiff
path: root/lto-plugin/lto-plugin.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-04-02 08:25:13 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-04-02 08:25:13 +0000
commit21b624f069b9e5b9c088f709cbc11704377e7a59 (patch)
treef712d4f96a28d54acaaf9ed9aed36915007ec792 /lto-plugin/lto-plugin.c
parenta1ce39befeec73a658a8644751cbd1793c319c7e (diff)
downloadgcc-21b624f069b9e5b9c088f709cbc11704377e7a59.zip
gcc-21b624f069b9e5b9c088f709cbc11704377e7a59.tar.gz
gcc-21b624f069b9e5b9c088f709cbc11704377e7a59.tar.bz2
lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin is set in COLLECT_GCC_OPTIONS.
2014-04-02 Richard Biener <rguenther@suse.de> * lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin is set in COLLECT_GCC_OPTIONS. From-SVN: r209011
Diffstat (limited to 'lto-plugin/lto-plugin.c')
-rw-r--r--lto-plugin/lto-plugin.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c
index 1432340..910e23c 100644
--- a/lto-plugin/lto-plugin.c
+++ b/lto-plugin/lto-plugin.c
@@ -1067,5 +1067,12 @@ onload (struct ld_plugin_tv *tv)
"could not register the all_symbols_read callback");
}
+ /* Support -fno-use-linker-plugin by failing to load the plugin
+ for the case where it is auto-loaded by BFD. */
+ char *collect_gcc_options = getenv ("COLLECT_GCC_OPTIONS");
+ if (collect_gcc_options
+ && strstr (collect_gcc_options, "'-fno-use-linker-plugin'"))
+ return LDPS_ERR;
+
return LDPS_OK;
}