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