From: Richard Biener Date: Wed, 2 Apr 2014 08:25:13 +0000 (+0000) Subject: lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin is set in COLLECT_GCC_O... X-Git-Tag: basepoints/gcc-5~115 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=21b624f069b9e5b9c088f709cbc11704377e7a59;p=thirdparty%2Fgcc.git lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin is set in COLLECT_GCC_OPTIONS. 2014-04-02 Richard Biener * lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin is set in COLLECT_GCC_OPTIONS. From-SVN: r209011 --- diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog index 8dcbc08bb5c6..de0db1db442c 100644 --- a/lto-plugin/ChangeLog +++ b/lto-plugin/ChangeLog @@ -1,3 +1,8 @@ +2014-04-02 Richard Biener + + * lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin + is set in COLLECT_GCC_OPTIONS. + 2014-03-28 Richard Biener * lto-plugin.c (process_symtab): Handle EINTR and short reads. diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c index 1432340b015c..910e23cd6092 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; }