Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936792 - www-client/chromium-127.0.6533.72 fails to compile with lto error
Summary: www-client/chromium-127.0.6533.72 fails to compile with lto error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-27 20:17 UTC by André Malo
Modified: 2024-08-09 05:36 UTC (History)
5 users (show)

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


Attachments
build.log (xz) (build.log.xz,609.18 KB, application/x-xz)
2024-07-27 20:23 UTC, André Malo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description André Malo 2024-07-27 20:17:23 UTC
Hi,

The latest chromium fails compiling with this error:

ld.lld: error: inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)

I've tried rebuilding without ccache. Still no good. I've tried putting the suggested option into the CFLAGS, but it seems to be filtered out. I'm going to attach the full build.log.

emerge --info looks like this:

Portage 3.0.65 (python 3.12.3-final-0, default/linux/amd64/23.0/split-usr/desktop/plasma, gcc-13, glibc-2.39-r6, 6.9.11-gentoo x86_64)
=================================================================
System uname: Linux-6.9.11-gentoo-x86_64-Intel-R-_Core-TM-_i7-6700K_CPU_@_4.00GHz-with-glibc2.39
KiB Mem:    32808444 total,   5262056 free
KiB Swap:   67108848 total,  64337392 free
Timestamp of repository gentoo: Sat, 27 Jul 2024 12:00:00 +0000
Head commit of repository gentoo: 298c457558df21c134dea4ba3bb9ec1076310f8b

sh bash 5.2_p26-r6
ld GNU ld (Gentoo 2.42 p3) 2.42.0
ccache version 4.9.1 [disabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r6::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.28.5::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.4.1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r3::gentoo
dev-lang/python:           2.7.18_p16-r2::gentoo, 3.8.19_p2::gentoo, 3.9.19_p3::gentoo, 3.10.14_p1-r1::gentoo, 3.11.9-r1::gentoo, 3.12.3-r1::gentoo, 3.13.0_beta4::gentoo
dev-lang/rust:             1.79.0::gentoo
dev-util/ccache:           4.9.1-r1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54.2::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo, 18.1.8::gentoo
sys-devel/gcc:             13.3.1_p20240614::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             17.0.6::gentoo, 18.1.8::gentoo
sys-devel/llvm:            17.0.6::gentoo, 18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
sys-libs/libselinux:       3.6-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage/
    priority: -1000
    volatile: True
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 3

Installed sets: @node
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -ggdb -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/sddm/scripts/ /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/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 -O2 -pipe -ggdb -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --quiet-build=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/     http://mirrors.ircam.fr/pub/gentoo-distfiles/     http://ftp.romnet.org/gentoo/     http://130.236.254.251/gentoo/     http://212.110.163.13/gentoo/     http://gentoo.mirrors.ovh.net/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="en"
MAKEOPTS="-j9"
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"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities aes alsa amd64 avx avx2 bluetooth branding bzip2 cairo cdda cdr cet cjk crypt cups dbus declarative dts dvd dvdr egl elogind encode exif flac fma3 gdbm gif glamor gles2 gpm gtk gui http2 iconv icu idn iproute2 ipv6 jpeg jpeg2k kde kf6compat kwallet lcms libnotify libtirpc lto lvm mad mmap mmx mmxext mng mp3 mp4 mpeg multilib ncurses networkmanager nscd ogg opengl openmp pam pango pclmul pcre pdf pipewire plasma png policykit popcnt ppds pulseaudio qml qt5 qt6 readline screencast sdl seccomp semantic-desktop smp sound spell split-usr sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg test-rust threads tiff truetype udev udisks uefi unicode upower urandom usb vaapi vorbis vulkan wayland webm webp widgets wxwidgets x264 xattr xcb xcomposite xft xinerama xml xscreensaver xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gcc_12" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="en" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_10 python3_11 python3_12 python3_13" RUBY_TARGETS="ruby31" SANE_BACKENDS="hp" VIDEO_CARDS="amdgpu radeonsi radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 André Malo 2024-07-27 20:23:01 UTC
Created attachment 898416 [details]
build.log (xz)
Comment 2 chrboesch@datexp.net 2024-07-30 16:42:33 UTC
Same error without any changes to prior settings.
Comment 3 chrboesch@datexp.net 2024-08-01 09:28:09 UTC
(In reply to chrboesch@datexp.net from comment #2)
> Same error without any changes to prior settings.

My workaround: In the directory "/etc/portage/package.use" a file "chromium" with entry "www-client/chromium -official -lto"
Comment 4 Matt Jolly gentoo-dev 2024-08-01 12:00:19 UTC
That will not be sufficient, and you should probably re-enable "official" for .88.

LTO now comes from CFLAGS, so package.env will be your best bet.

I'm still not sure what's causing this under some configurations, I suspect a USE that I haven't tried yet.
Comment 5 chrboesch@datexp.net 2024-08-01 13:37:17 UTC
(In reply to Matt Jolly from comment #4)
> That will not be sufficient, and you should probably re-enable "official"
> for .88.
> 
> LTO now comes from CFLAGS, so package.env will be your best bet.
> 
> I'm still not sure what's causing this under some configurations, I suspect
> a USE that I haven't tried yet.

I deactivated it again because it works with 127.0.6533.88. From my point of view the ticket is solved.
Comment 6 Zdenek Sojka 2024-08-04 06:59:20 UTC
(In reply to chrboesch@datexp.net from comment #5)
> (In reply to Matt Jolly from comment #4)
> > That will not be sufficient, and you should probably re-enable "official"
> > for .88.
> > 
> > LTO now comes from CFLAGS, so package.env will be your best bet.
> > 
> > I'm still not sure what's causing this under some configurations, I suspect
> > a USE that I haven't tried yet.
> 
> I deactivated it again because it works with 127.0.6533.88. From my point of
> view the ticket is solved.

I am hitting this with www-client/chromium-127.0.6533.88 , but I have non-standard CFLAGS (lto + -O3)

-Werror=odr -Werror=strict-aliasing -O3 -pipe -flto=auto -march=native -fno-stack-protector
Comment 7 Zdenek Sojka 2024-08-07 03:56:02 UTC
(In reply to Zdenek Sojka from comment #6)
> (In reply to chrboesch@datexp.net from comment #5)
> > (In reply to Matt Jolly from comment #4)
> > > That will not be sufficient, and you should probably re-enable "official"
> > > for .88.
> > > 
> > > LTO now comes from CFLAGS, so package.env will be your best bet.
> > > 
> > > I'm still not sure what's causing this under some configurations, I suspect
> > > a USE that I haven't tried yet.
> > 
> > I deactivated it again because it works with 127.0.6533.88. From my point of
> > view the ticket is solved.
> 
> I am hitting this with www-client/chromium-127.0.6533.88 , but I have
> non-standard CFLAGS (lto + -O3)
> 
> -Werror=odr -Werror=strict-aliasing -O3 -pipe -flto=auto -march=native
> -fno-stack-protector

And even with very basic cflags:

-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -O2 -pipe -flto=auto

(I've even removed -march=native)

...
FAILED: character_data_generator 
"python3.12" "../../build/toolchain/gcc_link_wrapper.py" --output="./character_data_generator" -- x86_64-pc-linux-gnu-clang++-18 -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl
,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -flto
=thin -Wl,--thinlto-jobs=all -Wl,-mllvm,-import-instr-limit=30 -Wl,-mllvm,-disable-auto-upgrade-debug-info -Wl,-mllvm,-inlinehint-threshold=360 -fwhole-program-vtables -Wl,--undefined-versio
n -Wl,--no-call-graph-profile-sort -no-canonical-prefixes -Wl,-z,defs -Wl,--as-needed -nostdlib++ -Wl,--lto-O0 -rdynamic -pie -Wl,--disable-new-dtags prebuilt_rustc_sysroot/lib/rustlib/x86_6
4-unknown-linux-gnu/lib/libstd.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if.rl
ib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore.rlib prebuilt_rustc_sysro
ot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknow
n-linux-gnu/lib/liblibc.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwi
nd.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect.rlib prebuilt_rus
tc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_
64-unknown-linux-gnu/lib/libunwind.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liba
dler.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr.rlib prebuilt_rustc_sysroot/
lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide.rlib prebuilt_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject.rlib -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-reloc
s -Wl,--undefined-version -o "./character_data_generator" -Wl,--start-group @"./character_data_generator.rsp" -Wl,--end-group   -ldl -lpthread -lrt -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 
-lglib-2.0 -licui18n -licuuc -licudata -latomic -lz -Wl,--start-group obj/third_party/rust/cxx/v1/lib/libcxx_lib.rlib obj/third_party/rust/serde_json_lenient/v0_2/wrapper/libthird_uparty_sru
st_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.rlib obj/third_party/rust/serde/v1/lib/libserde_lib.rlib obj/third_party/rust/serde_json_lenient/v0_2/lib/libserde_json_lenient_lib.rlib obj
/third_party/rust/itoa/v1/lib/libitoa_lib.rlib obj/third_party/rust/ryu/v1/lib/libryu_lib.rlib obj/build/rust/chromium_prelude/libchromium.rlib -Wl,--end-group 
ld.lld: error: inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)
x86_64-pc-linux-gnu-clang++-18: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 8 Matt Jolly gentoo-dev 2024-08-07 09:10:02 UTC
"Good" news. I've started hitting this too. I'm not sure why it's happening yet, but at least I can reproduce.
Comment 9 Larry the Git Cow gentoo-dev 2024-08-07 14:43:31 UTC
The bug has been closed via the following commit(s):

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

commit 213cf8bacaee8816cd161bf4f48879befede462d
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2024-08-07 10:26:20 +0000
Commit:     Matt Jolly <kangie@gentoo.org>
CommitDate: 2024-08-07 14:40:32 +0000

    www-client/chromium: add 127.0.6533.99
    
    Attempt to detect and `die` if ld is 'mold'.
    
    This is not supported and causes builds to fail
    when targets are linked.
    
    Bug: https://bugs.gentoo.org/936858
    Bug: https://bugs.gentoo.org/937510
    Closes: https://bugs.gentoo.org/936792
    Signed-off-by: Matt Jolly <kangie@gentoo.org>

 www-client/chromium/Manifest                      |    2 +
 www-client/chromium/chromium-127.0.6533.99.ebuild | 1480 +++++++++++++++++++++
 2 files changed, 1482 insertions(+)
Comment 10 Zdenek Sojka 2024-08-07 17:13:44 UTC
Thank you for the fix, but I don't have mold installed:

$ emerge -vp mold

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 5.98 s (backtrack: 0/20).

[ebuild  N     ] dev-libs/blake3-1.5.1::gentoo  237 KiB
[ebuild  N     ] dev-libs/mimalloc-2.1.2:0/2::gentoo  USE="-hardened -test -valgrind" ABI_X86="32 (64) (-x32)" 1137 KiB
[ebuild  N     ] sys-devel/mold-2.31.0::gentoo  9797 KiB
Comment 11 Zdenek Sojka 2024-08-07 18:33:55 UTC
It seems ld.lld tries to link objects (system libraries) compiled by gcc (with gcc LTO), with chromium objects compiled by llvm (with llvm LTO); all files are compiled with thin-lto only with format appropriate for the given compiler. Can that ever work?
Comment 12 Zdenek Sojka 2024-08-08 05:53:28 UTC
(In reply to Zdenek Sojka from comment #11)
> It seems ld.lld tries to link objects (system libraries) compiled by gcc
> (with gcc LTO), with chromium objects compiled by llvm (with llvm LTO); all
> files are compiled with thin-lto only with format appropriate for the given
> compiler. Can that ever work?

Please ignore this. I will try the new ebuild later.
Comment 13 Zdenek Sojka 2024-08-09 05:36:36 UTC
(In reply to Larry the Git Cow from comment #9)
> The bug has been closed via the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=213cf8bacaee8816cd161bf4f48879befede462d
> 
> commit 213cf8bacaee8816cd161bf4f48879befede462d
> Author:     Matt Jolly <kangie@gentoo.org>
> AuthorDate: 2024-08-07 10:26:20 +0000
> Commit:     Matt Jolly <kangie@gentoo.org>
> CommitDate: 2024-08-07 14:40:32 +0000
> 
>     www-client/chromium: add 127.0.6533.99
>     
>     Attempt to detect and `die` if ld is 'mold'.
>     
>     This is not supported and causes builds to fail
>     when targets are linked.
>     
>     Bug: https://bugs.gentoo.org/936858
>     Bug: https://bugs.gentoo.org/937510
>     Closes: https://bugs.gentoo.org/936792
>     Signed-off-by: Matt Jolly <kangie@gentoo.org>
> 
>  www-client/chromium/Manifest                      |    2 +
>  www-client/chromium/chromium-127.0.6533.99.ebuild | 1480
> +++++++++++++++++++++
>  2 files changed, 1482 insertions(+)

I have no clue how this helped, but it seems I am able to build chromium-127.0.6533.99 with LTO enabled. Thank you