Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 771909 - sys-fs/e2fsprogs-1.46.1 fails to build with USE="lto"
Summary: sys-fs/e2fsprogs-1.46.1 fails to build with USE="lto"
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2021-02-21 13:11 UTC by Robin Bankhead
Modified: 2021-02-23 07:01 UTC (History)
3 users (show)

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


Attachments
build log (sys-fs:e2fsprogs-1.46.1:20210221-122550.log,36.99 KB, text/plain)
2021-02-21 13:11 UTC, Robin Bankhead
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Bankhead 2021-02-21 13:11:07 UTC
Created attachment 687918 [details]
build log

This is my first ebuild attempted with the lto useflag so I imagine this applies to 1.46.0 as well.

Build is successful with USE="-lto".  I see that sys-devel/gcc has an "zstd" useflag: I surmise that were this enabled, the e2fsprogs build would also succeed? (This is on an old machine and I do not rebuild gcc on a whim, especially with lto)

Error message and preamble:
/usr/bin/gcc-ar rc libe2p.a feature.o fgetflags.o fsetflags.o fgetversion.o fsetversion.o getflags.o getversion.o hashstr.o iod.o ls.o ljs.o mntopts.o parse_num.o pe.o pf.o ps.o setflags.o setversion.o uuid.o ostype.o percent.o crypto_mode.o fgetproject.o fsetproject.o encoding.o errcode.o
/bin/rm -f ../libe2p.a
(cd ..; /bin/ln  \
	`echo lib/e2p | sed -e 's;lib/;;'`/libe2p.a libe2p.a)
(cd elfshared; x86_64-pc-linux-gnu-gcc -o libe2p.so.2.3 \
	-L../../../lib -g -flto -ffat-lto-objects    -pthread -Wl,-O1 -Wl,--as-needed -fPIC -shared \
	-Wl,-soname,libe2p.so.2 feature.o fgetflags.o fsetflags.o fgetversion.o fsetversion.o getflags.o getversion.o hashstr.o iod.o ls.o ljs.o mntopts.o parse_num.o pe.o pf.o ps.o setflags.o setversion.o uuid.o ostype.o percent.o crypto_mode.o fgetproject.o fsetproject.o encoding.o errcode.o )
lto1: internal compiler error: compiler does not support ZSTD LTO compression


$ emerge --info =sys-fs/e2fsprogs-1.46.1

Portage 3.0.14 (python 3.8.8-final-0, default/linux/amd64/17.1, gcc-10.2.0, glibc-2.32-r7, 5.10.4-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.4-gentoo-x86_64-AMD_Turion-tm-_II_Neo_N40L_Dual-Core_Processor-with-glibc2.2.5
KiB Mem:    16271864 total,   1788544 free
KiB Swap:    7577596 total,   7420988 free
Timestamp of repository gentoo: Sat, 20 Feb 2021 20:30:01 +0000
Head commit of repository gentoo: 648b4c87e4e8f669fa28ee0125ee8e11fe7b9b02
sh bash 5.1_p4
ld GNU gold (Gentoo 2.35.2 p1 2.35.2) 1.16
distcc 3.3.3 x86_64-pc-linux-gnu [enabled]
ccache version 4.2 [enabled]
app-shells/bash:          5.1_p4::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          2.7.18-r5::gentoo, 3.8.8::gentoo, 3.9.2::gentoo
dev-util/ccache:          4.2::gentoo
dev-util/cmake:           3.19.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7-r1::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.13.4-r2::gentoo, 1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            9.3.0::gentoo, 10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.3::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.11::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /home/cache/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 

squeezebox
    location: /var/lib/layman/squeezebox
    masters: gentoo
    priority: 0

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 1

Installed sets: @kde, @mailsrv, @mplayer, @nodejs
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=amdfam10 --param l1-cache-line-size=64 --param l2-cache-size=1024"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/portage/make.conf /usr/bin/pear /usr/bin/vncserver /usr/lib/X11/xdm/Xsetup_0 /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/hp/hplip.conf /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=amdfam10 --param l1-cache-line-size=64 --param l2-cache-size=1024"
DISTDIR="/home/cache/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --quiet-build=n --verbose-conflicts"
ENV_UNSET="CARGO_HOME 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 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache distcc distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirrors.ovh.net/gentoo-distfiles/ http://www.mirrorservice.org/sites/distfiles.gentoo.org/ http://gentoo.modulix.net/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB"
MAKEOPTS="-j8 -l4.5"
PKGDIR="/home/cache/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="/tmp"
USE="X X509 a52 aac acl acpi amd64 apache2 bash-completion berkdb bzip2 clamav cli crypt curl curlwrappers dbm dbus dbx dri dv dvd elogind enca encode exif fam fastcgi fat ffmpeg flac fortran ftp gd gd-external gdbm hardened iconv imagemagick imap imlib innodb ipv6 java javascript jpeg lcms libglvnd libkms libtirpc libwww lto lzo mad matroska mdadm minimal mp3 multilib mysql ncurses network nls nptl nsplugin ntfs offensive ogg openmp optimized-qmake pam pcre pcre16 php png policykit posix raw readline rtmp samba scanner seccomp session sharedmem soap split-usr ssl startup-notification tcpd theora threads tidy tiff tokenizer tordns truetype udev unicode usb vdpau vhosts x264 xattr xinetd xmlrpc xsl xv xvid xvmc xz zip zlib" ABI_X86="64" ADA_TARGET="gnat_2018" APACHE2_MODULES="access_compat actions alias auth_basic auth_digest authn_core authn_anon authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cache_disk cgid dav dav_fs dav_lock dbd deflate dir env expires ext_filter file_cache filter headers ident imagemap include info libass log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http proxy_wstunnel rewrite setenvif slotmem_shm so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" 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="pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" SANE_BACKENDS="hp net" USERLAND="GNU" VIDEO_CARDS="radeon r600 vesa" 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 Sergei Trofimovich gentoo-dev 2021-02-22 22:04:55 UTC
(In reply to Robin Bankhead from comment #0)
> Created attachment 687918 [details]
> build log
> 
> This is my first ebuild attempted with the lto useflag so I imagine this
> applies to 1.46.0 as well.
> 
> Build is successful with USE="-lto".  I see that sys-devel/gcc has an "zstd"
> useflag: I surmise that were this enabled, the e2fsprogs build would also
> succeed? (This is on an old machine and I do not rebuild gcc on a whim,
> especially with lto)
> 
> Error message and preamble:
> /usr/bin/gcc-ar rc libe2p.a feature.o fgetflags.o fsetflags.o fgetversion.o
> fsetversion.o getflags.o getversion.o hashstr.o iod.o ls.o ljs.o mntopts.o
> parse_num.o pe.o pf.o ps.o setflags.o setversion.o uuid.o ostype.o percent.o
> crypto_mode.o fgetproject.o fsetproject.o encoding.o errcode.o
> /bin/rm -f ../libe2p.a
> (cd ..; /bin/ln  \
> 	`echo lib/e2p | sed -e 's;lib/;;'`/libe2p.a libe2p.a)
> (cd elfshared; x86_64-pc-linux-gnu-gcc -o libe2p.so.2.3 \
> 	-L../../../lib -g -flto -ffat-lto-objects    -pthread -Wl,-O1
> -Wl,--as-needed -fPIC -shared \
> 	-Wl,-soname,libe2p.so.2 feature.o fgetflags.o fsetflags.o fgetversion.o
> fsetversion.o getflags.o getversion.o hashstr.o iod.o ls.o ljs.o mntopts.o
> parse_num.o pe.o pf.o ps.o setflags.o setversion.o uuid.o ostype.o percent.o
> crypto_mode.o fgetproject.o fsetproject.o encoding.o errcode.o )
> lto1: internal compiler error: compiler does not support ZSTD LTO compression
...
> ccache version 4.2 [enabled]

My guess is that if you clear you ccache cache you'll be able to build e2fsprogs with lto (or at least you will get a different error).

My guess is that you used to have a gcc with USE=zstd enabled before (it was an implicit flag) and ccache cached object files with zstd compression. Now your gcc only supports zlib compressed lto files.

ccache is very tricky to get right when underlying compiler changes.

I generally suggest using setup similar to https://wiki.gentoo.org /wiki/Ccache#Configuration 

    # Preserve cache across GCC rebuilds and
    # introspect GCC changes through GCC wrapper.
    compiler_check = %compiler% -v

Where very detailed compiler version seeds ccache key instead of a wrapper you might use.
Comment 2 Robin Bankhead 2021-02-22 23:46:40 UTC
OK, I see now. One of my distcc helpers (non-Gentoo) is built with zstd, so when I excluded that host the LTO build of e2fsprogs was successful.

That helper is prebuilt, so I guess I'll go ahead and enable zstd on my Gentoo gcc's.

Thanks for the tip.