https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63603

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-10-21
                 CC|                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm quite sure I tested that -fno-lto works.

> gcc-4.9 -flto -ffat-lto-objects -c t.c
> gcc-4.9 t.o -fno-lto -v 2>&1 | grep lto1
<nothing>

indeed it does.

> gcc-4.9 t.o -v 2>&1 | grep lto1
 /usr/lib64/gcc/x86_64-suse-linux/4.9/lto1 -quiet -dumpbase t.o -mtune=generic
-march=x86-64 -mtune=generic -march=x86-64 -auxbase t -version -fno-trapv
-fno-strict-overflow -fltrans-output-list=/tmp/ccRx0SND.ltrans.out -fwpa
-fresolution=/tmp/ccnlyyYA.res @/tmp/ccesvcXD
 /usr/lib64/gcc/x86_64-suse-linux/4.9/lto1 -quiet -dumpbase ccRx0SND.ltrans0.o
-mtune=generic -march=x86-64 -mtune=generic -march=x86-64 -auxbase-strip
/tmp/ccRx0SND.ltrans0.ltrans.o -version -fno-trapv -fno-strict-overflow
-fltrans-output-list=/tmp/ccRx0SND.ltrans.out -fltrans @/tmp/ccq0naMZ -o
/tmp/cchrU6el.s

Do you use a linker plugin with LTO?  That is, what's the value of
HAVE_LTO_PLUGIN
configure computes for you?

Do you happen to run a binutils and have lto_plugin.so installed as auto-load?

It seems that lto-plugin.c doesn't reject objects if COLLECT_GCC_OPTIONS
contains -fno-lto (but only -fno-use-linker-plugin).  Thus can you try
if

Index: lto-plugin/lto-plugin.c
===================================================================
--- lto-plugin/lto-plugin.c     (revision 216464)
+++ lto-plugin/lto-plugin.c     (working copy)
@@ -1071,7 +1071,8 @@ onload (struct ld_plugin_tv *tv)
      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'"))
+      && (strstr (collect_gcc_options, "'-fno-use-linker-plugin'")
+         || strstr (collect_gcc_options, "'-fno-lto'")))
     return LDPS_ERR;

fixes it for you?

Reply via email to