Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 733618 - dev-python/libvirt-python-6.2.0 fails to build with -flto, GCC lto ICE
Summary: dev-python/libvirt-python-6.2.0 fails to build with -flto, GCC lto ICE
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-23 02:24 UTC by Gabriel Marcano
Modified: 2020-07-24 18:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log showing ICE (build.log,18.00 KB, text/x-log)
2020-07-23 02:27 UTC, Gabriel Marcano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Marcano 2020-07-23 02:24:01 UTC
Trying to build dev-python/libvirt-python-6.2.0 with GCC 10.1 with the -flto useflag causes GCC to throw an internal compiler error, specifically:
    lto1: internal compiler error: resolution sub id 0xc7f780b4a6860cd3 not in object file

Reproducible: Always

Steps to Reproduce:
1. Add -flto to CFLAGS and CXXFLAGS
2. emerge -1 libvirt-python
Actual Results:  
lto1: internal compiler error: resolution sub id 0xc7f780b4a6860cd3 not in object file
x86_64-pc-linux-gnu-gcc -march=ivybridge -pipe -fomit-frame-pointer -O2 -flto -fPIC -I. -I/usr/include/python3.8 -c build/libvirt.c -o /tmp/portage/dev-python/libvirt-python-6.5.0/work/libvirt-python-6.5.0-python3_8/temp.linux-x86_64-3.8/build/libvirt.o
0x7f07f1b3ed59 __libc_start_main
        ../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Expected Results:  
emerge success.

I've added -flto to my CXXFLAGS and CFLAGS, and I am slowly letting programs update themselves to use LTO if possible (if not, I'm using -fno-lto in an an env configuration in package.env to disable it for those problematic ones).  For my use case I can disable LTO for libvirt-python (which builds in that case), but I wanted to report this bug as it is causing GCC to ICE when linking a shared object. Should I rebuild GCC with debugging symbols and -fno-omit-frame-pointer (I'm also building with -fomit-frame-pointer)?

Let me know if you need any more information or if you'd like for me to test changing flags around.

Here's my emerge --info:
Portage 3.0.0 (python 3.7.8-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-10.1.0, glibc-2.31-r6, 5.7.9-gentoo x86_64)
=================================================================
System uname: Linux-5.7.9-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.7
KiB Mem:    16351848 total,  11129284 free
KiB Swap:   16776192 total,  16233984 free
Timestamp of repository gentoo: Wed, 22 Jul 2020 15:45:01 +0000
Head commit of repository gentoo: eccde0ca97c9665973ebe134452751468be1e877
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, 3.9.0_beta5::gentoo
dev-util/ccache:          3.7.11::gentoo
dev-util/cmake:           3.17.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::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:            10.1.0-r2::gentoo
sys-devel/gcc-config:     2.3.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::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: rsync
    sync-uri: rsync://rsync.us.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

Local_Overlay
    location: /var/db/repos/local
    masters: gentoo
    eclass-overrides: gentoo Local_Overlay

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo
    eclass-overrides: gentoo crossdev

brother-overlay
    location: /var/lib/layman/brother-overlay
    masters: gentoo
    priority: 50

chrytoo
    location: /var/lib/layman/chrytoo
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=ivybridge -pipe -fomit-frame-pointer -O2 -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/brother/scanner/brscan4/brsanenetdevice4.cfg /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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/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="-march=ivybridge -pipe -fomit-frame-pointer -O2 -flto"
DISTDIR="/var/cache/distfiles"
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="-march=ivybridge -pipe -fomit-frame-pointer -O2 -flto"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=ivybridge -pipe -fomit-frame-pointer -O2 -flto"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en es"
MAKEOPTS="-j9"
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="/tmp"
USE="=-ppp X a52 aac acl acpi activities alsa amd64 avx bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr elogind emboss encode exif flac fortran gdbm gif gpm gtk iconv icu ipv6 jpeg kde kipi kwallet lcms ldap libnotify libtirpc lm-sensors lto mad mmx mng mp3 mp4 mpeg mtp multilib ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt qt5 readline sdl seccomp semantic-desktop spell split-usr sse sse2 sse3 sse4 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vdpau vorbis widgets wxwidgets x264 xattr xcb xml xv xvid zlib" 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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-64 emu" INPUT_DEVICES="evdev roccat_tyon" KERNEL="linux" L10N="en es" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7 python3_7 python3_8" RUBY_TARGETS="ruby25" SANE_BACKENDS="test" USERLAND="GNU" VIDEO_CARDS="nvidia" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Gabriel Marcano 2020-07-23 02:26:28 UTC
Crap, sorry, I noticed a typo in the title. I meant libvirt-python-6.5.0, not 6.2.0.

I'll upload the build log momentarily...
Comment 2 Gabriel Marcano 2020-07-23 02:27:29 UTC
Created attachment 650250 [details]
build.log showing ICE

This is the build log showing the ICE. Let me know if you need more information from me or need more information about my computer/environment to reproduce.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-07-23 14:14:48 UTC
(In reply to Gabriel Marcano from comment #2)
> Created attachment 650250 [details]
> build.log showing ICE
> 
> This is the build log showing the ICE. Let me know if you need more
> information from me or need more information about my computer/environment
> to reproduce.

Could you have a look at: https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide?
Comment 4 Gabriel Marcano 2020-07-24 18:37:31 UTC
GCC just updated to 10.2 yesterday, and since then I'm no longer able to reproduce the problem reliably. I had it crash once today after the GCC upgrade, but ever since I began playing with MAKEOPTS to see what would happen (changing -jN), I can't reproduce it anymore, even with the original values for the number of jobs (maybe it's a weird race condition that's rarer now?).

Other than that one failure earlier today, I can confirm it is building with -flto now. As a result, I will close this bug unless I can reproduce it again (I've re-emerged it 4 times already in a row, successfully).