public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls
@ 2012-02-07 21:00 matt at use dot net
  2012-02-07 22:00 ` [Bug lto/52159] " matt at use dot net
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: matt at use dot net @ 2012-02-07 21:00 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52159
           Summary: ICE when building qemu with GCC 4.7 trunk: cannot read
                    LTO decls
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: matt@use.net


Using the attached tarball, which is the Ubuntu source package configured with
CFLAGS="-O3 -flto -floop-block -floop-interchange" and LDFLAGS="-O3 -flto":


matt@matt-desktop:~/src/qemu-linaro-1.0.50-2012.01$ dh_auto_build -B
system-build
dh_auto_build: warning: line 1 of /home/matt/.config/dpkg/buildflags.conf
mentions unknown flag BUILD_CONFIG
dh_auto_build: warning: line 5 of /home/matt/.config/dpkg/buildflags.conf is
invalid, it has been ignored.
  LINK  x86_64-softmmu/qemu-system-x86_64
lto1: error: two or more sections for .gnu.lto_fprintf.4f35e9dac4cf72f5
lto1: internal compiler error: cannot read LTO decls from
/tmp/cc9TN5Ma.ltrans1.o
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: gcc returned 1 exit status
/usr/bin/ld.gold.real: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [qemu-system-x86_64] Error 1
make: *** [subdir-x86_64-softmmu] Error 2
dh_auto_build: make -j1 returned exit code 2
matt@matt-desktop:~/src/qemu-linaro-1.0.50-2012.01$ gcc --version
gcc (GCC) 4.7.0 20120207 (experimental)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

matt@matt-desktop:~/src/qemu-linaro-1.0.50-2012.01$ ld --version
GNU gold (GNU Binutils for Ubuntu 2.22) 1.11
Copyright 2011 Free Software Foundation, Inc.


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

* [Bug lto/52159] ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls
  2012-02-07 21:00 [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls matt at use dot net
@ 2012-02-07 22:00 ` matt at use dot net
  2012-02-08 10:38 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: matt at use dot net @ 2012-02-07 22:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Matt Hargett <matt at use dot net> 2012-02-07 22:00:12 UTC ---
Created attachment 26606
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26606
tarball of ltrans temporaries that reproduce this bug, from Ubuntu source
package for qemu-linaro


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

* [Bug lto/52159] ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls
  2012-02-07 21:00 [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls matt at use dot net
  2012-02-07 22:00 ` [Bug lto/52159] " matt at use dot net
@ 2012-02-08 10:38 ` rguenth at gcc dot gnu.org
  2015-05-04 13:03 ` steffen at hauihau dot de
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-08 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-08 10:38:31 UTC ---
It seems that for some weird reason you got two sections for the function
fprintf.  Which means that there were two functions fprintf that have not
been merged at WPA stage.


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

* [Bug lto/52159] ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls
  2012-02-07 21:00 [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls matt at use dot net
  2012-02-07 22:00 ` [Bug lto/52159] " matt at use dot net
  2012-02-08 10:38 ` rguenth at gcc dot gnu.org
@ 2015-05-04 13:03 ` steffen at hauihau dot de
  2015-05-04 13:04 ` steffen at hauihau dot de
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: steffen at hauihau dot de @ 2015-05-04 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

Steffen Hau <steffen at hauihau dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steffen at hauihau dot de

--- Comment #3 from Steffen Hau <steffen at hauihau dot de> ---
I don't know wether this is a GCC issue, but I have recompiled all my packages
on Gentoo with GCC 5.1.0 and LD Gold from binutils 2.25 and ran into the same
error for Qemu 2.3.0:

x86_64-pc-linux-gnu-g++ -I/usr/include/pixman-1   -fPIE -DPIE -m64
-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes
-fno-strict-aliasing -fno-common  -Wendif-labels -Wmissing-include-dirs
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self
-Wignored-qualifiers -Wold-style-declaration -Wold-style-definition
-Wtype-limits -fstack-protector-strong   -I/usr/include/libpng16 
-I/usr/include/libusb-1.0 
-I/home/gentoo/tmp/portage/app-emulation/qemu-2.3.0/work/qemu-2.3.0/tests
-pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -march=native
-O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block
-ftree-loop-distribution -fira-loop-pressure -ftree-vectorize
-ftree-loop-linear -flto=5 -fuse-linker-plugin -Wl,-z,relro -Wl,-z,now -pie
-m64 -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe -ggdb -floop-interchange
-floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure
-ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -Wl,-znow
-Wl,--sort-common -Wl,--hash-style=gnu -Wl,--enable-new-dtags -o qemu-img
qemu-img.o async.o thread-pool.o nbd.o block.o blockjob.o main-loop.o
iohandler.o qemu-timer.o aio-posix.o qemu-io-cmds.o qemu-coroutine.o
qemu-coroutine-lock.o qemu-coroutine-io.o qemu-coroutine-sleep.o
coroutine-ucontext.o block/raw_bsd.o block/qcow.o block/vdi.o block/vmdk.o
block/cloop.o block/dmg.o block/bochs.o block/vpc.o block/vvfat.o block/qcow2.o
block/qcow2-refcount.o block/qcow2-cluster.o block/qcow2-snapshot.o
block/qcow2-cache.o block/qed.o block/qed-gencb.o block/qed-l2-cache.o
block/qed-table.o block/qed-cluster.o block/qed-check.o block/vhdx.o
block/vhdx-endian.o block/vhdx-log.o block/parallels.o block/blkdebug.o
block/blkverify.o block/block-backend.o block/snapshot.o block/qapi.o
block/raw-posix.o block/linux-aio.o block/null.o block/mirror.o block/nbd.o
block/nbd-client.o block/sheepdog.o block/accounting.o block/write-threshold.o
block/curl.o  libqemuutil.a libqemustub.a   -lz -lbz2 -laio -lcurl -lm
-lgthread-2.0 -pthread -lglib-2.0   -lz -lrt -lz -lcap-ng -luuid  -lutil
lto1: error: two or more sections for .gnu.lto_fprintf.bea14a90a0409768
(null):0: confused by earlier errors, bailing out
make: *** [/tmp/ccPpXBxT.ltrans11.ltrans.o] Error 1
make: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/../../../../x86_64-pc-linux-gnu/bin/ld:
fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status


The same happens with LD BFD. Only workaround is to disable LTO. GCC 4.9.2
doesn't show this error and compiles the code. I was able to break down the
Object List to three files which reproduce the error reliably. I compiled the
files with the "--save-temps" switch, but I'm not able, to reproduce the error
with the resulting .i files because of other compiler errors like "'abc' does
not name a type" or "error: 'xyz' was not declared in this scope".

I'll attach the preprocessed sources as well as the commandline options I've
used to compile and link. Please let me know if I need to provide further
information.


gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/5.1.0/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/5.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/home/gentoo/tmp/portage/sys-devel/gcc-5.1.0/work/gcc-5.1.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/5.1.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.1.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.1.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.1.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/g++-v5
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/5.1.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 5.1.0 p1.0, pie-0.6.3' --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj
--enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts
--enable-lto --with-isl --disable-isl-version-check --enable-libsanitizer
Thread model: posix
gcc version 5.1.0 (Gentoo 5.1.0 p1.0, pie-0.6.3) 


ld -v
GNU gold (Gentoo 2.25 p1.1 2.25) 1.11


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

* [Bug lto/52159] ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls
  2012-02-07 21:00 [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls matt at use dot net
                   ` (2 preceding siblings ...)
  2015-05-04 13:03 ` steffen at hauihau dot de
@ 2015-05-04 13:04 ` steffen at hauihau dot de
  2015-05-04 14:20 ` trippels at gcc dot gnu.org
  2015-05-05 12:23 ` trippels at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: steffen at hauihau dot de @ 2015-05-04 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Steffen Hau <steffen at hauihau dot de> ---
Created attachment 35452
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35452&action=edit
preprocessed sources and minimal build script


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

* [Bug lto/52159] ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls
  2012-02-07 21:00 [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls matt at use dot net
                   ` (3 preceding siblings ...)
  2015-05-04 13:04 ` steffen at hauihau dot de
@ 2015-05-04 14:20 ` trippels at gcc dot gnu.org
  2015-05-05 12:23 ` trippels at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-05-04 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trippels at gcc dot gnu.org

--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Steffen Hau from comment #3)
> 
> The same happens with LD BFD. Only workaround is to disable LTO. GCC 4.9.2
> doesn't show this error and compiles the code. I was able to break down the
> Object List to three files which reproduce the error reliably. I compiled
> the files with the "--save-temps" switch, but I'm not able, to reproduce the
> error with the resulting .i files because of other compiler errors like
> "'abc' does not name a type" or "error: 'xyz' was not declared in this
> scope".

This happens because you use gcc for compiling and g++ for linking in your 
build script.


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

* [Bug lto/52159] ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls
  2012-02-07 21:00 [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls matt at use dot net
                   ` (4 preceding siblings ...)
  2015-05-04 14:20 ` trippels at gcc dot gnu.org
@ 2015-05-05 12:23 ` trippels at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-05-05 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

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

--- Comment #6 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
dup

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


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

end of thread, other threads:[~2015-05-05 12:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07 21:00 [Bug lto/52159] New: ICE when building qemu with GCC 4.7 trunk: cannot read LTO decls matt at use dot net
2012-02-07 22:00 ` [Bug lto/52159] " matt at use dot net
2012-02-08 10:38 ` rguenth at gcc dot gnu.org
2015-05-04 13:03 ` steffen at hauihau dot de
2015-05-04 13:04 ` steffen at hauihau dot de
2015-05-04 14:20 ` trippels at gcc dot gnu.org
2015-05-05 12:23 ` trippels 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).