Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923840 - www-client/chromium-122.0.6261.18: ld.lld: error: inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)
Summary: www-client/chromium-122.0.6261.18: ld.lld: error: inconsistent LTO Unit split...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-05 18:37 UTC by Steffen Hau
Modified: 2024-02-18 19:09 UTC (History)
2 users (show)

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


Attachments
chromium-122.0.6261.18-build.log part 1 (chromium-122.0.6261.18-build.log.xz00,1000.00 KB, application/x-xz)
2024-02-07 12:54 UTC, Steffen Hau
Details
chromium-122.0.6261.18-build.log part 2 (chromium-122.0.6261.18-build.log.xz01,152.20 KB, application/octet-stream)
2024-02-07 12:55 UTC, Steffen Hau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Hau 2024-02-05 18:37:47 UTC
Tried to give compiling chromium with lto use flag enabled another try. After approx 12.5 hours, it failed with:
ld.lld: error: inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)

emerge --info from a previous build with lto use flag disabled:
Portage 3.0.61 (python 3.11.7-final-0, default/linux/amd64/23.0/systemd, gcc-13, glibc-2.38-r10, 6.7.3-HAUIHAU x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.7.3-HAUIHAU-x86_64-Intel-R-_Core-TM-_i5-8259U_CPU_@_2.30GHz-with-glibc2.38
KiB Mem:     8022976 total,    988744 free
KiB Swap:   33554424 total,  33462008 free
Timestamp of repository gentoo: Mon, 05 Feb 2024 09:48:20 +0000
Head commit of repository gentoo: ee0ba356264e180b83c6fdcedccb237293e3721a

sh bash 5.2_p26
ld GNU ld (Gentoo 2.41 p5) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.28.2::gentoo
dev-build/libtool:         2.4.7-r2::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.3.1-r1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1_p1::gentoo
dev-lang/rust:             1.74.1::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          255.3::gentoo
sys-devel/binutils:        2.41-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20240113-r1::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             17.0.6::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-kernel/linux-headers:  6.7::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r10::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

hauihau
    location: /var/db/repos/hauihau
    masters: gentoo
    priority: 0
    volatile: False

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe -flto=auto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-march=native -O3 -pipe -flto=auto"
DISTDIR="/home/gentoo/distfiles/"
EMERGE_DEFAULT_OPTS="--autounmask=n --keep-going=y --quiet-build=y --quiet-fail=y --with-bdeps=y --changed-deps-report=n"
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 fakeroot fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox pkgdir-index-trusted 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="https://ftp.fau.de/gentoo/ https://ftp.gwdg.de/pub/linux/gentoo/ https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--gc-sections -fuse-ld=mold"
LEX="flex"
LINGUAS="de"
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="/home/gentoo/tmp/"
SHELL="/bin/bash"
USE="a52 aac aalib acl alsa amd64 avx avx2 bluetooth bluray branding bzip2 cairo caps cdda cddb crypt cups curl cxx dbus dri dts dvd egl encode exif ffmpeg flac fontconfig ftp gd gdbm gif gmp gstreamer iconv icu ipv6 jpeg jpeg2k kde kerberos lame libnotify libsamplerate libtirpc lzma lzo mad matroska mmx mmxext mng mp3 mpeg mtp multilib musepack ncurses networkmanager nls nptl ogg openal opengl openmp opus pam pcre pdf pipewire png policykit pulseaudio qt5 readline screencast seccomp sndfile spell sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 svg systemd test-rust theora threads tiff truetype udev unicode upower usb v4l vaapi vim-syntax vorbis vulkan wavpack wayland x264 xattr xml xmp xvid zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" 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" 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 rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="libinput" KERNEL="linux" L10N="de" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby31" VIDEO_CARDS="intel" 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, 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

=================================================================
                        Package Settings
=================================================================

www-client/chromium-122.0.6261.18::gentoo was built with the following:
USE="cups kerberos official proprietary-codecs pulseaudio qt5 screencast system-harfbuzz system-icu system-png system-toolchain system-zstd vaapi wayland widevine -X -custom-cflags -debug -gtk4 -hangouts (-headless) -libcxx -lto -pax-kernel (-pgo) -qt6 (-selinux)" ABI_X86="(64)" L10N="de -af -am -ar -bg -bn -ca -cs -da -el -en-GB -es -es-419 -et -fa -fi -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt-BR -pt-PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -ur -vi -zh-CN -zh-TW"
CFLAGS="-march=native -O3 -pipe -flto=auto -fno-lto -Wno-unknown-warning-option"
CXXFLAGS="-march=native -O3 -pipe -flto=auto -fno-lto -Wno-unknown-warning-option"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--gc-sections -fuse-ld=mold -fno-lto -Wl,--undefined-version"


-fno-lto comes from env/no-lto.conf which I commented out in package.env, I also set LDFLAGS so that -fuse-ld=mold is not set. Let me know if you need further information.

Reproducible: Always
Comment 1 Steffen Hau 2024-02-05 18:40:17 UTC
Unfortunately the xz compressed build.log is to big (1356 kb). Any alternative to upload it?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-06 06:34:53 UTC
(In reply to Steffen Hau from comment #1)
> Unfortunately the xz compressed build.log is to big (1356 kb). Any
> alternative to upload it?

If you try ansifilter it, then xz -9e, does that help?

If not, try split.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-07 00:37:00 UTC
This might be related to the Rust nightly stuff we patch out. One of the flags sounded like this, I think (sorry, can't check rn).
Comment 4 Steffen Hau 2024-02-07 12:54:42 UTC
Created attachment 884466 [details]
chromium-122.0.6261.18-build.log part 1
Comment 5 Steffen Hau 2024-02-07 12:55:38 UTC
Created attachment 884467 [details]
chromium-122.0.6261.18-build.log part 2
Comment 6 Steffen Hau 2024-02-07 12:56:22 UTC
ansifilter + xz -9e wasn't enough, sadly, so I splitted the .xz with split -b 1000.
Comment 7 Steffen Hau 2024-02-10 10:44:49 UTC
www-client/chromium-122.0.6261.29 shows the same error:

FAILED: v8_context_snapshot_generator 
"python3.11" "../../build/toolchain/gcc_link_wrapper.py" --output="./v8_context_snapshot_generator" -- x86_64-pc-linux-gnu-clang++ -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 -fwhole-program-vtables -Wl,--undefined-version -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 -Wl,--icf=none prebuilt_rustc_sysroot/lib/rustlib/x86_64-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.rlib 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_sysroot/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-unknown-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_unwind.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_rustc_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/libadler.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-relocs -Wl,--gc-sections -Wl,--undefined-version -o "./v8_context_snapshot_generator" -Wl,--start-group @"./v8_context_snapshot_generator.rsp"  -Wl,--end-group  -ldl -lpthread -lrt -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -licui18n -licuuc -licudata -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -ldbus-1 -latomic -lz -lresolv -lgio-2.0 -lzstd -ljpeg -lpng16 -lxml2 -lxslt -lexpat -lwebp -lwebpdemux -lwebpmux -lfreetype -lfontconfig -lharfbuzz-subset -lharfbuzz -lopenh264 -lm -lgbm -lEGL -ldrm -lxkbcommon -lpci -lffi -lpangocairo-1.0 -lpango-1.0 -lcairo -lasound -lpulse -lFLAC -latk-1.0 -latk-bridge-2.0 -latspi obj/third_party/rust/cxx/v1/lib/libcxx_lib.rlib obj/skia/libskia_cbridge_urust_uside.rlib obj/third_party/rust/font_types/v0_4/lib/libfont_types_lib.rlib obj/third_party/rust/read_fonts/v0_15/lib/libread_fonts_lib.rlib obj/third_party/rust/skrifa/v0_15/lib/libskrifa_lib.rlib obj/build/rust/chromium_prelude/libchromium.rlib obj/third_party/blink/common/rust_crash/libthird_uparty_sblink_scommon_srust_ucrash_crs.rlib
ld.lld: error: inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)
x86_64-pc-linux-gnu-clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 8 Steffen Hau 2024-02-18 19:09:51 UTC
I successfully merged chromium with use lto enabled.

I have set -flto=auto in my CFLAGS/CXXFLAGS in make.conf, this lead to compiler invocations like "clang++ ... -flto=thin .... -flo=auto". I checked what the final options are by using -### and it came out that the last -flto wins. -flto=auto in clang will be set to -flto=full and that lead to several issues like this and bug906548.