Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 733886

Summary: sys-devel/gcc-10.2.0: lto1: internal compiler error: bytecode stream: expected tag identifier_node instead of LTO_UNKNOWN
Product: Gentoo Linux Reporter: Johannes Hirte <johannes.hirte>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED INVALID    
Severity: critical CC: sam, slyfox
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
environment

Description Johannes Hirte 2020-07-25 13:39:06 UTC
Building app-emulation/qemu-5.0.0-r2 with gcc-10.2.0 resulting in an ICE:

x86_64-pc-linux-gnu-g++ -O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe -Wno-unused-function -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -static -m64  -fstack-protector-strong  -o qemu-aarch64 exec.o exec-vary.o tcg/tcg.o tcg/tcg-op.o tcg/tcg-op-vec.o tcg/tcg-op-gvec.o tcg/tcg-common.o tcg/optimize.o fpu/softfloat.o disas.o gdbstub-xml.o gdbstub.o thunk.o accel/stubs/hax-stub.o accel/stubs/hvf-stub.o accel/stubs/whpx-stub.o accel/stubs/kvm-stub.o accel/tcg/tcg-runtime.o accel/tcg/tcg-runtime-gvec.o accel/tcg/cpu-exec.o accel/tcg/cpu-exec-common.o accel/tcg/translate-all.o accel/tcg/translator.o accel/tcg/user-exec.o accel/tcg/user-exec-stub.o linux-user/main.o linux-user/syscall.o linux-user/strace.o linux-user/mmap.o linux-user/signal.o linux-user/elfload.o linux-user/linuxload.o linux-user/uaccess.o linux-user/uname.o linux-user/safe-syscall.o linux-user/aarch64/signal.o linux-user/aarch64/cpu_loop.o linux-user/exit.o linux-user/fd-trans.o linux-user/flatload.o linux-user/arm/semihost.o target/arm/arm-semi.o target/arm/helper.o target/arm/vfp_helper.o target/arm/cpu.o target/arm/gdbstub.o target/arm/cpu64.o target/arm/gdbstub64.o target/arm/kvm-stub.o target/arm/tlb_helper.o target/arm/debug_helper.o target/arm/translate.o target/arm/op_helper.o target/arm/crypto_helper.o target/arm/iwmmxt_helper.o target/arm/vec_helper.o target/arm/neon_helper.o target/arm/m_helper.o target/arm/translate-a64.o target/arm/helper-a64.o target/arm/translate-sve.o target/arm/sve_helper.o target/arm/pauth_helper.o trace/generated-helpers.o trace/control-target.o ../cpus-common.o ../disas/arm.o ../disas/arm-a64.o ../disas/i386.o ../disas/libvixl/vixl/utils.o ../disas/libvixl/vixl/compiler-intrinsics.o ../disas/libvixl/vixl/a64/instructions-a64.o ../disas/libvixl/vixl/a64/decoder-a64.o ../disas/libvixl/vixl/a64/disasm-a64.o ../hw/core/qdev.o ../hw/core/qdev-properties.o ../hw/core/bus.o ../hw/core/cpu.o ../hw/core/resettable.o ../hw/core/hotplug.o ../hw/core/vmstate-if.o ../hw/core/irq.o ../qom/object.o ../qom/container.o ../qom/qom-qobject.o ../qom/object_interfaces.o  ../libqemuutil.a    -lm -lz -lgthread-2.0 -pthread -lglib-2.0 -pthread -lpcre -pthread  -lrt
lto1: internal compiler error: bytecode stream: expected tag identifier_node instead of LTO_UNKNOWN
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:208: qemu-arm] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-emulation/qemu-5.0.0-r2/work/qemu-5.0.0/user-build/arm-linux-user'
make: *** [Makefile:527: arm-linux-user/all] Error 2
make: *** Waiting for unfinished jobs....
lto1: internal compiler error: bytecode stream: expected tag identifier_node instead of LTO_UNKNOWN
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:208: qemu-aarch64] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-emulation/qemu-5.0.0-r2/work/qemu-5.0.0/user-build/aarch64-linux-user'
make: *** [Makefile:527: aarch64-linux-user/all] Error 2


Reproducible: Always




emerge --info
Portage 3.0.0 (python 3.8.5-final-0, default/linux/amd64/17.1/systemd, gcc-10.2.0, glibc-2.31-r6, 5.8.0-rc6-00146-g23ee3e4e5bd2 x86_64)
=================================================================
System uname: Linux-5.8.0-rc6-00146-g23ee3e4e5bd2-x86_64-AMD_Ryzen_5_PRO_2500U_w-_Radeon_Vega_Mobile_Gfx-with-glibc2.2.5
KiB Mem:    14272832 total,   4267036 free
KiB Swap:    2097148 total,   2097148 free
Head commit of repository gentoo: a6b01c5fc75a0e63aa7cc907f2ce8b545998cbfc

Head commit of repository kde: 7318b8b9cfc9d2a172e75701ea95f63f7cffa0f5

Head commit of repository qt: 5c76498b7f0c2d4bdccc9110d53655accac74a38

sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p4) 2.34.0
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
ccache version 3.7.11 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo
dev-util/ccache:          3.7.11::gentoo
dev-util/cmake:           3.18.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.34-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo, 10.2.0::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/gentoo.git
    priority: -1000

kde
    location: /var/db/repos/kde
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

local
    location: /var/db/repos/local
    masters: gentoo
    priority: 50

qt
    location: /var/db/repos/qt
    sync-type: git
    sync-uri: git://anongit.gentoo.org/proj/qt.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/db/repos/steam-overlay
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=n"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j8 -l8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac aacplus acl activities alsa alt-svc amd64 amr amrenc anacron berkdb blake2 bluetooth brotli bzip2 cairo caps celt chm cleartype_hinting cli corefonts crypt cryptsetup cups d3d9 dav1d dbus dell device-mapper djvu dri drm dvd ebook editorconfig efi egl eps epub evdev exif faac fdk ffmpeg fftw flac fontconfig fortran gbm gdbm gif git glamor glslang gmp gold gpg gphoto2 gpm graphviz harfbuzz http2 iconv icu id3tag io-uring ipv6 ithreads jpeg kipi lcms lensfun libaom libatomic libcxx libcxxabi libffi libinput libkms libsamplerate libtirpc libunwind libxml2 lm-sensors lz4 lzma lzo mad matroska mjpeg mmap mng mobi modern-top mp3 mpeg mtp multilib mysql ncurses networkmanager nfs nls nptl ogg openal opencv openexr opengl openmp openssl opus pam parted pcre pcre16 pdf png policykit postscript pulseaudio python qml qt5 raw readline rtmp s3tc schroedinger sdl sdl2 seccomp sift smp sndfile sox speex spice split-usr sqlite ssl subversion svg system-jsoncpp system-sqlite system-zlib systemd taglib tcpd tesseract theora threads thumbnail tiff truetype udev uefi unicode urandom usb usbredir user-session v4l vaapi vde vdpau vhosts virgl virt-network virtfs vorbis vpx vte vulkan wavpack wayland webp wmf x264 x265 xattr xcb xcomposite xkb xml xmp xpm xv xvid xxhash zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="canon ricoh ricoh_g3" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 ssse3 sse4_1 sse4_2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64 pc" INPUT_DEVICES="evdev libinput synaptics" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF NVPTX X86" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_7 python3_8" QEMU_SOFTMMU_TARGETS="aarch64 arm i386 x86_64" QEMU_USER_TARGETS="aarch64 arm" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Johannes Hirte 2020-07-25 13:40:11 UTC
Created attachment 650706 [details]
build.log
Comment 2 Johannes Hirte 2020-07-25 13:40:32 UTC
Created attachment 650708 [details]
environment
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-25 13:57:58 UTC
> -static

Given that you are using static linking with lto make sure you have rebuilt all static libraries with new gcc: https://gcc.gnu.org/PR62083
Comment 4 Johannes Hirte 2020-07-25 14:24:46 UTC
(In reply to Sergei Trofimovich from comment #3)
> > -static
> 
> Given that you are using static linking with lto make sure you have rebuilt
> all static libraries with new gcc: https://gcc.gnu.org/PR62083

I've enabled lto selective for some packages, but not for qemu. Does this error come from a package build with lto and is linked in by qemu? I'm suspecting glib.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-25 14:47:31 UTC
(In reply to Johannes Hirte from comment #4)
> (In reply to Sergei Trofimovich from comment #3)
> > > -static
> > 
> > Given that you are using static linking with lto make sure you have rebuilt
> > all static libraries with new gcc: https://gcc.gnu.org/PR62083
> 
> I've enabled lto selective for some packages, but not for qemu. Does this
> error come from a package build with lto and is linked in by qemu? I'm
> suspecting glib.

Oh, that's an interesting failure mode. Yeah, that might be it. Ideally such static libraries should be built with -ffat-lto-objects, so these .a files could be used in non-lto contexts.
Comment 6 Johannes Hirte 2020-07-25 15:42:11 UTC
(In reply to Johannes Hirte from comment #4)
> (In reply to Sergei Trofimovich from comment #3)
> > > -static
> > 
> > Given that you are using static linking with lto make sure you have rebuilt
> > all static libraries with new gcc: https://gcc.gnu.org/PR62083
> 
> I've enabled lto selective for some packages, but not for qemu. Does this
> error come from a package build with lto and is linked in by qemu? I'm
> suspecting glib.

Nailed it! Re-emerging dev-libs/glib solved it. I'm building dev-libs/glib with the this flags:

COMMON_FLAGS="-O2 -ggdb -flto=8 -fuse-linker-plugin -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
LDFLAGS="${LDFLAGS} ${COMMON_FLAGS}"

FEATURES="${FEATURES} splitdebug"

MAKEOPTS="-j8 -l8"
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-25 17:15:02 UTC
(In reply to Johannes Hirte from comment #6)
> (In reply to Johannes Hirte from comment #4)
> > (In reply to Sergei Trofimovich from comment #3)
> > > > -static
> > > 
> > > Given that you are using static linking with lto make sure you have rebuilt
> > > all static libraries with new gcc: https://gcc.gnu.org/PR62083
> > 
> > I've enabled lto selective for some packages, but not for qemu. Does this
> > error come from a package build with lto and is linked in by qemu? I'm
> > suspecting glib.
> 
> Nailed it! Re-emerging dev-libs/glib solved it. I'm building dev-libs/glib
> with the this flags:

Glad you've nailed it! If the mere rebuid was enough then it probably was a mismatch of lto formats (or contents) across gcc versions.