lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin is set in COLLECT_GCC_O...
authorRichard Biener <rguenther@suse.de>
Wed, 2 Apr 2014 08:25:13 +0000 (08:25 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 2 Apr 2014 08:25:13 +0000 (08:25 +0000)
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

lto-plugin/ChangeLog
lto-plugin/lto-plugin.c

index 8dcbc08bb5c6a890e6409b8d9f781a54f32754af..de0db1db442c9ca949cc1991434ec92746dbf6f3 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2014-03-28  Richard Biener  <rguenther@suse.de>
 
        * lto-plugin.c (process_symtab): Handle EINTR and short reads.
index 1432340b015c92cf51f26d14eb3f71ca77bb45a1..910e23cd6092df6fcb80ec120fdfb5ed728e3dc2 100644 (file)
@@ -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;
 }