public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/49677] New: GCC 4.6.0 LTO files not compatible with GCC 4.6.1
@ 2011-07-08 14:56 edwintorok at gmail dot com
  2011-08-21 15:52 ` [Bug lto/49677] " xunxun1982 at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: edwintorok at gmail dot com @ 2011-07-08 14:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49677

           Summary: GCC 4.6.0 LTO files not compatible with GCC 4.6.1
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: edwintorok@gmail.com


Created attachment 24714
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24714
test.o

Using gcc 4.6.1 to link objects compiled with GCC 4.6.0 -flto produces this
error:
$ gcc test.o -flto -shared
lto1: error: bad value (generic) for -mtls-dialect= switch
lto-wrapper: /usr/bin/gcc returned 1 exit status
/usr/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status

There is no -mtls-dialect=generic flag, (and there wasn't either).
Instead there is an -mtune=generic flag:
COLLECT_GCC_OPTIONS='-flto' '-shared' '-v' '-mtune=generic' '-march=x86-64'

I think 4.6.1 confuses -mtune and -mtls-dialect when loading 4.6.0 LTO objects.
Maybe the LTO version should be bumped to make these objects incompatible?

Fixing this compile error is possible if:
 - make clean in all the projects that you link in
 - ccache -C, ccache -c to delete all cached objects from previous version

It'd be better if GCC automatically detected that a certain LTO object file is
not compatible, and say which one it is.

In any case it'd be useful if there would be a -Wlto-mismatch, that would warn
if LTO objects were produced with different GCC versions (.comment section
should contain full version), or if the LTO objects and current compiler
version are different.

gcc -v output:
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-multiarch
--with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/x86_64-linux-gnu
--enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Debian 4.6.1-2) 

I'm attaching the test.o file, because it the bug doesn't reproduce if I
compile it again from source with 4.6.1, only if I use the object file compiled
by 4.6.0.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/49677] GCC 4.6.0 LTO files not compatible with GCC 4.6.1
  2011-07-08 14:56 [Bug lto/49677] New: GCC 4.6.0 LTO files not compatible with GCC 4.6.1 edwintorok at gmail dot com
@ 2011-08-21 15:52 ` xunxun1982 at gmail dot com
  2011-10-30 16:14 ` andi-gcc at firstfloor dot org
  2012-01-10 15:05 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: xunxun1982 at gmail dot com @ 2011-08-21 15:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49677

PcX <xunxun1982 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xunxun1982 at gmail dot com

--- Comment #1 from PcX <xunxun1982 at gmail dot com> 2011-08-21 15:33:07 UTC ---
I can confirm the error.
And I found that, if I update to a newer gcc, for example, gcc 4.6.2
(20110819), their LTO information will be not compatible.
It also will cause the errors : 
lto1: error: bad value (generic) for -mtls-dialect= switch
lto-wrapper: /usr/bin/gcc returned 1 exit status
/usr/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status

In the end, I must recompile it using the newer gcc with LTO.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/49677] GCC 4.6.0 LTO files not compatible with GCC 4.6.1
  2011-07-08 14:56 [Bug lto/49677] New: GCC 4.6.0 LTO files not compatible with GCC 4.6.1 edwintorok at gmail dot com
  2011-08-21 15:52 ` [Bug lto/49677] " xunxun1982 at gmail dot com
@ 2011-10-30 16:14 ` andi-gcc at firstfloor dot org
  2012-01-10 15:05 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: andi-gcc at firstfloor dot org @ 2011-10-30 16:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49677

Andi Kleen <andi-gcc at firstfloor dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andi-gcc at firstfloor dot
                   |                            |org

--- Comment #2 from Andi Kleen <andi-gcc at firstfloor dot org> 2011-10-30 16:14:06 UTC ---
This is a dup of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44965
Someone added a new option

I posted a patch to handle this specific case, but it wasn't accepted.
http://gcc.gnu.org/ml/gcc-patches/2010-10/msg00098.html

I believe there's an effort underway now to rewrite the lto option code which
will likely fix the problems.

Maybe the old patch is still a good idea for 4.6.x?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug lto/49677] GCC 4.6.0 LTO files not compatible with GCC 4.6.1
  2011-07-08 14:56 [Bug lto/49677] New: GCC 4.6.0 LTO files not compatible with GCC 4.6.1 edwintorok at gmail dot com
  2011-08-21 15:52 ` [Bug lto/49677] " xunxun1982 at gmail dot com
  2011-10-30 16:14 ` andi-gcc at firstfloor dot org
@ 2012-01-10 15:05 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-10 15:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49677

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-10 15:05:16 UTC ---
The issue was fixed differently for trunk.  Dup.

*** This bug has been marked as a duplicate of bug 44965 ***


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-10 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-08 14:56 [Bug lto/49677] New: GCC 4.6.0 LTO files not compatible with GCC 4.6.1 edwintorok at gmail dot com
2011-08-21 15:52 ` [Bug lto/49677] " xunxun1982 at gmail dot com
2011-10-30 16:14 ` andi-gcc at firstfloor dot org
2012-01-10 15:05 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).