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

Bug 682018

Summary: dev-libs/isl-0.21 with LTO enabled - x86_64-pc-linux-gnu-gcc: error trying to exec '/usr/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/collect2': execv: Argument list too long
Product: Gentoo Linux Reporter: Fabio Coatti <fabio.coatti>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: matoro_bugzilla_gentoo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gcc.gnu.org/PR89896
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
Clean Isl Build With Gcc LTO System-WIDE
0001-isl-rename-all.-c-h-to-all_headers.-c-h.patch

Description Fabio Coatti 2019-03-29 14:07:48 UTC
I have lto enabled system-wide and with the latest isl update I'm getting this error:
x86_64-pc-linux-gnu-gcc: error trying to exec '/usr/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/collect2': execv: Argument list too long
(full build log attached).
turning off lto makes the compilation to go thru.

Reproducible: Always




Portage 2.3.62 (python 3.5.7-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-8.3.0, glibc-2.28-r5, 5.0.4-cova x86_64)
=================================================================
System uname: Linux-5.0.4-cova-x86_64-Intel-R-_Core-TM-_i7-6820HQ_CPU_@_2.70GHz-with-gentoo-2.6
KiB Mem:    65295816 total,  48086080 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Fri, 29 Mar 2019 12:44:36 +0000
Head commit of repository gentoo: e54cab41ede848b25feed5062c636e0e1a87b652

sh bash 5.0_p3-r1
ld GNU gold (Gentoo 2.32 p1 2.32.0) 1.16
app-shells/bash:          5.0_p3-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          2.7.16::gentoo, 3.5.7::gentoo, 3.6.8::gentoo, 3.7.2::gentoo
dev-util/cmake:           3.14.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.17::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32::gentoo
sys-devel/gcc:            8.3.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: https://github.com/gentoo/kde.git
    masters: gentoo
    priority: 50

local
    location: /usr/overlay
    masters: gentoo
    priority: 51

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"
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 /usr/share/sddm/scripts/Xsetup"
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=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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 -pipe"
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 sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirror.netcologne.de/gentoo/ http://gentoo.mirrors.ovh.net/gentoo-distfiles/ https://mirrors.evowise.com/gentoo/"
LANG="en_IE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="en it de"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
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="3dnow 3dnowext 3dnowprefetch X \ a52 aac aalib acl acpi activities aim alsa amd64 apng appstream ares asf ati audio audiofile avahi bash-completion berkdb bidi bl bluetooth branding bri bzip2 cairo caps cdda cdr cjk cli crypt cups curl cxx dba dbus declarative device-mapper dga divx divx4linux dri dts dv dvb dvd dvdr dvdread eap-sim edl egl emboss encode ethereal evdev exif expat faad fam fame fbcon ffmpeg fftw flac force-cgi-redirect fortran ftp gallium garmin gd gdbm gif gimp glamor gmedia gmp gnutls gphoto2 gpm gps gsm gtk h264 h323 iconv icq icu idn ifp ilbc imagemagick imap innodb ipod iproute2 ipv6 ithreads jabber java javascript joystick jpeg kde kipi kontact kvm kwallet lastfm lcms ldap libnotify libtirpc libvirtd live lm_sensors lua lvm lxc lzma lzo mad maildir matroska mbox mdnsresponder-compat mhash mime mjpeg mmap mmx mmxext mng mozdevelop mozilla mp3 mp4 mpeg msn mtp multilib mysql ncurses network networkmanager new-hpcups nfsv4 njb nls nptl nptlonly offensive ofx ogg oggvorbis ogm openal openexr opengl openmp oscar pam pango parted pcap pcre pdf phonon php plasma plotutils png policykit ppds pulseaudio qemu qml qt5 readline real rtc ruby samba sasl sdl seccomp semantic-desktop semantic-destkop sha512 sip slang slp smartcard sndfile snmp sox speex spell srt sse sse2 ssh ssl ssse3 startup-notification svg symlink systemd tcltk tcpd telepathy theora threads tiff tk touchpad tremor truetype udev udisks unicode upower usb utempter v4l v4l2 vaapi vcd vde vdpaum vhosts video videos vim-syntax virt-network virtualbox vorbis vulkan wav wayland webkit widgets wifi wmf wmp wps wxwidgets wxwindows x264 xanim xattr xcb xcomposite xface xft xine xinerama xml xosd xpm xscreensaver xsl xv xvid zeroconf zlib zpm" ABI_X86="64 32" 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 avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en it de en_IE" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_5 python3_6" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby24 ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="i965 intel nvidia v4l" 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 Fabio Coatti 2019-03-29 14:08:14 UTC
Created attachment 571184 [details]
build.log
Comment 2 Ostashevskyi Viktor 2019-03-30 09:20:03 UTC
I confirm, same issue.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-30 10:31:29 UTC
(In reply to Fabio Coatti from comment #0)
> I have lto enabled system-wide and with the latest isl update I'm getting
> this error:
> x86_64-pc-linux-gnu-gcc: error trying to exec
> '/usr/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/collect2': execv: Argument list
> too long
> (full build log attached).
> turning off lto makes the compilation to go thru.

You have a lot of flags. What does "turning off lto" mean specifically? Dropping -flto=* from CFLAG/LDFLAGS? Or all the non-standard flags?

> CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"

You should never pass -fpic and -fpie to CFLAGS. -fpic tends to break glibc and -fpie might interfere with explicit -fPIC for shared libraries.
Comment 4 Anthony Basile gentoo-dev 2019-03-30 11:02:24 UTC
(In reply to Ostashevskyi Viktor from comment #2)
> I confirm, same issue.

Okay this is a regression in 0.21.  Since this breaks the toolchain, I've masked it.

@testers.  How did you restore your toolchain after upgrading to 0.21?
Comment 5 Anthony Basile gentoo-dev 2019-03-30 11:04:19 UTC
(In reply to Sergei Trofimovich from comment #3)
> (In reply to Fabio Coatti from comment #0)
> > I have lto enabled system-wide and with the latest isl update I'm getting
> > this error:
> > x86_64-pc-linux-gnu-gcc: error trying to exec
> > '/usr/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/collect2': execv: Argument list
> > too long
> > (full build log attached).
> > turning off lto makes the compilation to go thru.
> 
> You have a lot of flags. What does "turning off lto" mean specifically?
> Dropping -flto=* from CFLAG/LDFLAGS? Or all the non-standard flags?

I'm testing this on a fresh stage3 with USE=lto being the only change.
Comment 6 Kyle Elbert 2019-03-30 11:29:12 UTC
I had the same issue, with similarly long CFLAGS ( CFLAGS="-march=native -O2 -pipe -falign-functions=32 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize -flto=6 -fuse-linker-plugin"
) but just shortening it by changing -flto=6 to -flto was enough to get it to build successfully (and havn't yet ran into any issues building various things with it)
Comment 7 Kyle Elbert 2019-03-30 11:39:05 UTC
(In reply to Kyle Elbert from comment #6)
> I had the same issue, with similarly long CFLAGS ( CFLAGS="-march=native -O2
> -pipe -falign-functions=32 -fno-semantic-interposition -fgraphite-identity
> -floop-nest-optimize -flto=6 -fuse-linker-plugin"
> ) but just shortening it by changing -flto=6 to -flto was enough to get it
> to build successfully (and havn't yet ran into any issues building various
> things with it)

other *FLAGS
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
CFLAGS="-march=native -O2 -pipe -falign-functions=32 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize -flto=6 -fuse-linker-plugin"

CXXFLAGS and other *FLAGS same as above
Comment 8 Carlos Jimenez 2019-03-30 11:43:15 UTC
Maybe You People Are Doing Something Wrong , And Your Systems Are All Broken ,
My ToolChain IS Fine Here Today I Notice That Gcc Wants To Be REcompiled Because ISL Downgrade . Everything Is Fine HERE. My Gcc Compiled Against isl-0.21 is just fine 
I have Emerged A Bunch Of Pkgs With This Gcc . Cheers .
Comment 9 Carlos Jimenez 2019-03-30 11:44:33 UTC
Created attachment 571240 [details]
Clean Isl Build With Gcc LTO System-WIDE
Comment 10 Carlos Jimenez 2019-03-30 11:48:29 UTC
emerge --info
Portage 2.3.62 (python 3.7.3-final-0, default/linux/amd64/17.1/systemd, gcc-8.3.0, glibc-2.28-r5, 5.0.5-gentoo x86_64)
=================================================================
System uname: Linux-5.0.5-gentoo-x86_64-Intel-R-_Core-TM-_i5-4200M_CPU_@_2.50GHz-with-gentoo-2.6
KiB Mem:     3924524 total,    538528 free
KiB Swap:    5131260 total,   5093680 free
Timestamp of repository gentoo: Sat, 30 Mar 2019 11:04:21 +0000
Head commit of repository gentoo: 75acd20e92b6541533aa7987f8b6f498e54d697c

Timestamp of repository poly-c: Sat, 30 Mar 2019 08:36:52 +0000
sh bash 5.0_p3-r1
ld GNU ld (Gentoo 2.32 p1) 2.32.0
ccache version 3.6 [disabled]
app-shells/bash:          5.0_p3-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.8::gentoo, 3.7.3::gentoo
dev-util/ccache:          3.6::gentoo
dev-util/cmake:           3.14.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::poly-c
sys-apps/sandbox:         2.17::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32::gentoo
sys-devel/gcc:            8.3.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000

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

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

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

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

mate-de-gentoo
    location: /var/lib/layman/mate-de-gentoo
    masters: gentoo
    priority: 50

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

poly-c
    location: /var/lib/layman/poly-c
    masters: gentoo
    priority: 50

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

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

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

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=1 -fuse-linker-plugin -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=1 -fuse-linker-plugin -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=1 -fuse-linker-plugin -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-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 sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -mfpmath=both -funroll-loops -floop-block -floop-interchange -floop-strip-mine -falign-functions=32 -O3 -fgraphite-identity -floop-nest-optimize -fno-semantic-interposition -flto=1 -fuse-linker-plugin -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="en"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
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="10bit X a52 aac acl adplug alsa amd64 animation-rtl apng applet archive berkdb bluetooth branding bs2b btrfs bzip2 cairo caja calf cdda cdr cli crypt cue curl custom-cflags custom-optimization cxx dav1d dbus dga dri dri3 drm dts dvd egl exif f2fs fat fbcon fdk ffmpeg ffmpeg-codecs flac fontconfig fortran fuse gbm gdbm gif git gles gles1 gles2 gnome-keyring gpm gstreamer gtk hddtemp hfs http http2 iconv image-converter infinality introspection ipv6 jbig jfs jpeg jpeg2k kms ladspa lame lash lcms ldap libass libcaca libcanberra libdrm libkms libnotify libsamplerate libtirpc lm_sensors lua lz4 lzma lzo mad magic mda-lv2 mng mod modern-top modplug mp3 mp4 mpeg mtp multilib native-headset ncurses network networkmanager nls nptl nsplugin ntfs ofono-headset ogg openal opengl openh264 openmp openrc opus pam pango pcre pdf plugin-checksum plugin-fishlim plugin-sysinfo plymouth png policykit portaudio postproc pulseaudio python raw readline reiser4 reiserfs resolvconf sdl sdl2 seccomp sensord sensors smpeg sndfile sound spell ssl startup-notification svg systemd systray tcpd theora threads tiff truetype udev udf udisks unicode upower usb uxa vaapi vorbis vpx vulkan wavpack wayland webp wifi wxwidgets x264 x265 xattr xcb xfs xinerama xml xmp xpm xpresent xvid xvmc zlib zstd" ABI_X86="64 32" 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 avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_6 python3_7" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="intel i965" 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 11 Guillaume Ceccarelli 2019-03-30 16:42:40 UTC
I can confirm that this bug occurs on -flto=N for N > 1. Compiling with -flto=1 works.

This is probably an issue with changes in isl's build system. I think flto=X should be overridden to flto=1 and that this package should otherwise be unmasked.

See also the corresponding bug on the gentoo-lto overlay project: https://github.com/InBetweenNames/gentooLTO/issues/264
Comment 12 Fabio Coatti 2019-03-30 18:45:51 UTC
(In reply to Sergei Trofimovich from comment #3)


> (In reply to Fabio Coatti from comment #0)
> > I have lto enabled system-wide and with the latest isl update I'm getting
> > this error:
> > x86_64-pc-linux-gnu-gcc: error trying to exec
> > '/usr/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/collect2': execv: Argument list
> > too long
> > (full build log attached).
> > turning off lto makes the compilation to go thru.
> 
> You have a lot of flags. What does "turning off lto" mean specifically?
> Dropping -flto=* from CFLAG/LDFLAGS? Or all the non-standard flags?

Complete lines, one failing one working (even though later comments seems to confirm the issue with LTO):

Not working: 
 libtool: link: x86_64-pc-linux-gnu-gcc -m32 -shared  -fPIC -DPIC  .libs/isl_gmp.o .libs/isl_val_gmp.o .libs/isl_aff.o .libs/isl_aff_map.o .libs/isl_affine_hull.o .libs/isl_arg.o .libs/isl_ast.o .libs/isl_ast_build.o .libs/isl_ast_build_expr.o .libs/isl_ast_codegen.o .libs/isl_ast_graft.o .libs/basis_reduction_tab.o .libs/isl_bernstein.o .libs/isl_blk.o .libs/isl_bound.o .libs/isl_box.o .libs/isl_coalesce.o .libs/isl_constraint.o .libs/isl_convex_hull.o .libs/isl_ctx.o .libs/isl_deprecated.o .libs/isl_dim_map.o .libs/isl_equalities.o .libs/isl_factorization.o .libs/isl_farkas.o .libs/isl_ffs.o .libs/isl_flow.o .libs/isl_fold.o .libs/isl_hash.o .libs/isl_id_to_ast_expr.o .libs/isl_id_to_id.o .libs/isl_id_to_pw_aff.o .libs/isl_ilp.o .libs/isl_input.o .libs/isl_local.o .libs/isl_local_space.o .libs/isl_lp.o .libs/isl_map.o .libs/isl_map_list.o .libs/isl_map_simplify.o .libs/isl_map_subtract.o .libs/isl_map_to_basic_set.o .libs/isl_mat.o .libs/isl_morph.o .libs/isl_id.o .libs/isl_obj.o .libs/isl_options.o .libs/isl_output.o .libs/isl_point.o .libs/isl_polynomial.o .libs/isl_printer.o .libs/print.o .libs/isl_range.o .libs/isl_reordering.o .libs/isl_sample.o .libs/isl_scan.o .libs/isl_schedule.o .libs/isl_schedule_band.o .libs/isl_schedule_node.o .libs/isl_schedule_read.o .libs/isl_schedule_tree.o .libs/isl_schedule_constraints.o .libs/isl_scheduler.o .libs/isl_set_list.o .libs/isl_sort.o .libs/isl_space.o .libs/isl_stream.o .libs/isl_seq.o .libs/isl_stride.o .libs/isl_tab.o .libs/isl_tab_pip.o .libs/isl_tarjan.o .libs/isl_transitive_closure.o .libs/isl_union_map.o .libs/isl_val.o .libs/isl_vec.o .libs/isl_version.o .libs/isl_vertices.o   -lgmp  -m32 -march=native -O3 -flto=4 -fuse-linker-plugin -fstack-protector-strong -Wl,-O1 -Wl,--as-needed -march=native -O3 -flto=4 -fuse-linker-plugin -fstack-protector-strong -Wl,--as-needed -Wl,--hash-style=gnu   -Wl,-soname -Wl,libisl.so.21 -o .libs/libisl.so.21.0.0
x86_64-pc-linux-gnu-gcc: error trying to exec '/usr/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/collect2': execv: Argument list too long

Working: 
libtool: link: x86_64-pc-linux-gnu-gcc -shared  -fPIC -DPIC  .libs/isl_gmp.o .libs/isl_val_gmp.o .libs/isl_aff.o .libs/isl_aff_map.o .libs/isl_affine_hull.o .libs/isl_arg.o .libs/isl_ast.o .libs/isl_ast_build.o .libs/isl_ast_build_expr.o .libs/isl_ast_codegen.o .libs/isl_ast_graft.o .libs/basis_reduction_tab.o .libs/isl_bernstein.o .libs/isl_blk.o .libs/isl_bound.o .libs/isl_box.o .libs/isl_coalesce.o .libs/isl_constraint.o .libs/isl_convex_hull.o .libs/isl_ctx.o .libs/isl_deprecated.o .libs/isl_dim_map.o .libs/isl_equalities.o .libs/isl_factorization.o .libs/isl_farkas.o .libs/isl_ffs.o .libs/isl_flow.o .libs/isl_fold.o .libs/isl_hash.o .libs/isl_id_to_ast_expr.o .libs/isl_id_to_id.o .libs/isl_id_to_pw_aff.o .libs/isl_ilp.o .libs/isl_input.o .libs/isl_local.o .libs/isl_local_space.o .libs/isl_lp.o .libs/isl_map.o .libs/isl_map_list.o .libs/isl_map_simplify.o .libs/isl_map_subtract.o .libs/isl_map_to_basic_set.o .libs/isl_mat.o .libs/isl_morph.o .libs/isl_id.o .libs/isl_obj.o .libs/isl_options.o .libs/isl_output.o .libs/isl_point.o .libs/isl_polynomial.o .libs/isl_printer.o .libs/print.o .libs/isl_range.o .libs/isl_reordering.o .libs/isl_sample.o .libs/isl_scan.o .libs/isl_schedule.o .libs/isl_schedule_band.o .libs/isl_schedule_node.o .libs/isl_schedule_read.o .libs/isl_schedule_tree.o .libs/isl_schedule_constraints.o .libs/isl_scheduler.o .libs/isl_set_list.o .libs/isl_sort.o .libs/isl_space.o .libs/isl_stream.o .libs/isl_seq.o .libs/isl_stride.o .libs/isl_tab.o .libs/isl_tab_pip.o .libs/isl_tarjan.o .libs/isl_transitive_closure.o .libs/isl_union_map.o .libs/isl_val.o .libs/isl_vec.o .libs/isl_version.o .libs/isl_vertices.o   -lgmp  -O2 -march=native -fstack-protector-strong -fuse-linker-plugin -Wl,-O1 -Wl,--as-needed -march=native -O3 -flto=4 -fuse-linker-plugin -fstack-protector-strong -Wl,--as-needed -Wl,--hash-style=gnu   -Wl,-soname -Wl,libisl.so.21 -o .libs/libisl.so.21.0.0

> 
> > CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"
> 
> You should never pass -fpic and -fpie to CFLAGS. -fpic tends to break glibc
> and -fpie might interfere with explicit -fPIC for shared libraries.

I'm not sure how this can be even related to this bug, however can you elaborate? "tends to break" is not really clear to me what it means. On my system I have no issues that can be correlated to -fpic, afaik. I admit I'm not really sure how pie can interfere with PIC for share libraries, to be honest. Do you have some links to collect more info? THanks.
Comment 13 Fabio Coatti 2019-03-30 20:02:29 UTC
(In reply to Guillaume Ceccarelli from comment #11)
> I can confirm that this bug occurs on -flto=N for N > 1. Compiling with
> -flto=1 works.
> 
> This is probably an issue with changes in isl's build system. I think flto=X
> should be overridden to flto=1 and that this package should otherwise be
> unmasked.
> 
> See also the corresponding bug on the gentoo-lto overlay project:
> https://github.com/InBetweenNames/gentooLTO/issues/264

Indeed. On my system the compilation that failed before goes thru by using -flto=1

Thanks.
Comment 14 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-30 20:11:03 UTC
This fails:
  CFLAGS="-O2 -flto=4 -pipe"
  CXXFLAGS="${CFLAGS}"
  LDFLAGS="${CFLAGS}

This works:
  CFLAGS="-O2 -flto -pipe"
  CXXFLAGS="${CFLAGS}"
  LDFLAGS="${CFLAGS}

I think this preliminary points us as at LTO partitioning bug in gcc, not the problem in dev-libs/isl package.
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-31 00:26:10 UTC
Got very fancy reproducer locally. Will post more detail tomorrow.

The investigation so far:

The gist of a bug is 'all.c' file in new isl-0.21 release. It tricks libtool (or gcc?) into sourcing all.o as an input to intermediate lto partitions and breaks things.

One of the workarounds is to rename all.c source file into something else in irc release.

I'll spend some time tracking down special all.o handling tomorrow.
Comment 16 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-31 09:32:54 UTC
Here is the full reproducer:

$ cat foo.bash 
#!/bin/bash

export LANG=C

cc=gcc

mk() {
    local flag=$1

    rm -rf -- *.o *.so*

    ${cc} ${flag} -fPIC -c all.c -o all.o
    ${cc} ${flag} -fPIC -c isl.c -o isl.o
    # Note: all.o is not used here and yet in interferes with -flto=4
    ${cc} ${flag} -fPIC -shared isl.o -o libisl.so
}

# empty files are enough to trigger a bug
touch all.c isl.c

echo "=== -flto=1 (works) ==="
mk "-flto=1"

echo "=== -flto=4 (fails) ==="
mk "-flto=4"


$ ./foo.bash
=== -flto=1 (works) ===
=== -flto=4 (fails) ===
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib64/../lib64/Scrt1.o: in function `_start':
/usr/src/debug/sys-libs/glibc-2.29-r1/glibc-2.29/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: all] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
Comment 17 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-31 09:44:41 UTC
Filed upstream as https://gcc.gnu.org/PR89896
Comment 18 Sergei Trofimovich (RETIRED) gentoo-dev 2019-04-02 08:34:13 UTC
Created attachment 571562 [details, diff]
0001-isl-rename-all.-c-h-to-all_headers.-c-h.patch

0001-isl-rename-all.-c-h-to-all_headers.-c-h.patch is a working workaround for isl ebuild until gcc is fixed.
Comment 19 Larry the Git Cow gentoo-dev 2019-04-04 07:03:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6480d86a84ad176452fa3b269570f372bcf84d6e

commit 6480d86a84ad176452fa3b269570f372bcf84d6e
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-04-04 06:57:36 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-04-04 06:57:36 +0000

    8.3.0: backport -flto=2 build failure on isl (all.c)
    
    Reported-by: Fabio Coatti
    Bug: https://gcc.gnu.org/PR89896
    Bug: https://bugs.gentoo.org/682018
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 8.3.0/gentoo/27_all_flto-make-all.patch | 31 +++++++++++++++++++++++++++++++
 8.3.0/gentoo/README.history             |  1 +
 2 files changed, 32 insertions(+)
Comment 20 Sergei Trofimovich (RETIRED) gentoo-dev 2019-04-04 07:05:38 UTC
Queued gcc fix for next gcc-8.3.0 patchset.

Also send a workaround patch to isl upstream as:
    https://groups.google.com/forum/#!topic/isl-development/UpfDyz2i1EY
Comment 21 Larry the Git Cow gentoo-dev 2019-04-06 12:45:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c8e228e9ad5ff6e81cf0fb3a6c0f7fb2929519bf

commit c8e228e9ad5ff6e81cf0fb3a6c0f7fb2929519bf
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-04-06 10:44:29 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-04-06 10:44:29 +0000

    8.3.0: cut 1.1 patchset
    
    Three new patches:
    - 26_all_overridable_native.patch
    - 27_all_flto-make-all.patch
    - 28_all_i386_retpoline-and-jumptable.patch
    
    Bug: https://bugs.gentoo.org/679738
    Bug: https://bugs.gentoo.org/682018
    Bug: https://bugs.gentoo.org/682218
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 8.3.0/gentoo/README.history | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 22 Larry the Git Cow gentoo-dev 2019-04-06 12:50:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce95a47723f26ab8a687c3dffeea80aea71bfd87

commit ce95a47723f26ab8a687c3dffeea80aea71bfd87
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-04-06 12:49:11 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-04-06 12:49:50 +0000

    sys-devel/gcc: cut 1.1 patchset for 8.3.0
    
    Three new patches:
    - 26_all_overridable_native.patch
    - 27_all_flto-make-all.patch
    - 28_all_i386_retpoline-and-jumptable.patch
    
    This is also the first EAPI=6 gcc ebuild.
    
    Closes: https://bugs.gentoo.org/679738
    Closes: https://bugs.gentoo.org/682018
    Closes: https://bugs.gentoo.org/682218
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-devel/gcc/Manifest            |  1 +
 sys-devel/gcc/gcc-8.3.0-r1.ebuild | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
Comment 23 Guillaume Ceccarelli 2019-04-06 21:38:34 UTC
Thank you Sergei!

Should isl-0.21 now be unmasked?
Comment 24 Anthony Basile gentoo-dev 2019-04-06 21:48:14 UTC
(In reply to Guillaume Ceccarelli from comment #23)
> Thank you Sergei!
> 
> Should isl-0.21 now be unmasked?

yep.  i'll get it
Comment 25 Fabio Coatti 2019-04-07 11:44:36 UTC
Thanks a lot for the effort!