Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 940199 - www-client/chromium-129.0.6668.58 "ld.lld: error: undefined hidden symbol: OPENSSL_get_ia32cap" with -flto without -march=
Summary: www-client/chromium-129.0.6668.58 "ld.lld: error: undefined hidden symbol: OP...
Status: RESOLVED UPSTREAM
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: lto
  Show dependency tree
 
Reported: 2024-09-24 14:47 UTC by Zdenek Sojka
Modified: 2024-12-05 11:11 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2024-09-24 14:47:48 UTC
When trying to work around PR918894 by not specifying the -march=, build with -flto fails with:
...
# emerge -v www-client/chromium
[ebuild   R    ] www-client/chromium-129.0.6668.58:0/stable::gentoo  USE="X cups gtk4 hangouts official proprietary-codecs pulseaudio qt5 qt6 system-harfbuzz system-icu system-png system-toolchain system-zstd vaapi wayland widevine -bindist -custom-cflags -debug -ffmpeg-chromium (-headless) -kerberos -pax-kernel (-pgo) -screencast (-selinux)" L10N="cs -af -am -ar -bg -bn -ca -da -de -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" 0 KiB
...
[30225/63199] "python3.12" "../../build/toolchain/gcc_link_wrapper.py" --output="./generate_colors_info" -- x86_64-pc-linux-gnu-clang++-18 -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noex
...
FAILED: generate_colors_info 
...
ld.lld: error: undefined hidden symbol: OPENSSL_get_ia32cap
>>> referenced by ld-temp.o
>>>               ./generate_colors_info.lto.o:(sha1_block_data_order)
>>> referenced by ld-temp.o
>>>               ./generate_colors_info.lto.o:(sha1_block_data_order)
>>> referenced by ld-temp.o
>>>               ./generate_colors_info.lto.o:(sha1_block_data_order)
>>> referenced 5 more times
x86_64-pc-linux-gnu-clang++-18: error: linker command failed with exit code 1 (use -v to see invocation)
...

The build works:
- without -flto on a core2 machine (with or without -mtune=native -msse4.1)
- with and without -flto with -march=native and -O2 or -O3 on a zen2 machine
The build does NOT work:
- with -flto without -march= anywhere
- with and without -flto with -march=native on core2 (due to PR918894)

Irrespective of not/using ccache.

It seems I can't build www-client/chromium with -flto on older machines.

The symbol seems to be present:
# file ./www-client/chromium-129.0.6668.58/work/chromium-129.0.6668.58/out/Release/obj/third_party/boringssl/boringssl/crypto.o
./www-client/chromium-129.0.6668.58/work/chromium-129.0.6668.58/out/Release/obj/third_party/boringssl/boringssl/crypto.o: LLVM IR bitcode
# nm ./www-client/chromium-129.0.6668.58/work/chromium-129.0.6668.58/out/Release/obj/third_party/boringssl/boringssl/crypto.o
         U CRYPTO_get_fork_generation
00000000 T CRYPTO_has_asm
         U CRYPTO_init_sysrand
00000000 T CRYPTO_is_confidential_build
00000000 T CRYPTO_library_init
00000000 T CRYPTO_malloc_init
         U CRYPTO_once
00000000 T CRYPTO_pre_sandbox_init
00000000 T ENGINE_load_builtin_engines
00000000 T ENGINE_register_all_complete
00000000 T OPENSSL_cleanup
         U OPENSSL_cpuid_setup
00000000 T OPENSSL_get_ia32cap
00000000 T OPENSSL_ia32cap_P
00000000 T OPENSSL_init_cpuid
00000000 T OPENSSL_init_crypto
00000000 T OPENSSL_load_builtin_modules
00000000 T OPENSSL_malloc_init
00000000 T OpenSSL_version
00000000 T OpenSSL_version_num
00000000 T SSLeay
00000000 T SSLeay_version

I don't know why it's not used.

Reproducible: Always

Steps to Reproduce:
1. in CFLAGS, enable -flto, disable -march= (and better any other -m flag)
2. emerge -v www-client/chromium
3. observe failure
Actual Results:  
Link error:
ld.lld: error: undefined hidden symbol: OPENSSL_get_ia32cap


Expected Results:  
Build succeeds.

# emerge --info
Portage 3.0.65 (python 3.12.6-final-0, default/linux/amd64/23.0/split-usr/desktop/plasma, gcc-13, glibc-2.39-r6, 6.10.11-gentoo-dist x86_64)
=================================================================
System uname: Linux-6.10.11-gentoo-dist-x86_64-AMD_Ryzen_7_4800H_with_Radeon_Graphics-with-glibc2.39
KiB Mem:    65210460 total,  13546956 free
KiB Swap:  268435452 total, 267926780 free
Timestamp of repository gentoo: Tue, 24 Sep 2024 03:30:01 +0000
Head commit of repository gentoo: 303294cca50bc728d1c1bb5a4975e8011fcf0d97
Timestamp of repository gamerlay: Thu, 19 Sep 2024 02:05:52 +0000
Head commit of repository gamerlay: 24992e740ca57c2a2063b4fa6b6ccb207e5be9ac

Timestamp of repository gogooverlay: Sun, 08 Sep 2024 18:37:14 +0000
Head commit of repository gogooverlay: 85cd85702b1535a72209609417bedd8f8d964cde

Timestamp of repository palemoon: Tue, 10 Sep 2024 12:34:00 +0000
Head commit of repository palemoon: 40204b04b8c9cdd96c1695535be0dc2d175048bc

Timestamp of repository steam-overlay: Sun, 08 Sep 2024 18:36:43 +0000
Head commit of repository steam-overlay: 9e11573f22a5ab039769afea81b31ccd89af454e

Head commit of repository tlp: af2991838d36eb8337616cb66dcda93d455fdd66

Timestamp of repository x11: Sun, 08 Sep 2024 18:36:47 +0000
Head commit of repository x11: 3de32e500e15bd3dc3880247c49b212657ffbf50

sh bash 5.2_p26-r6
ld GNU ld (Gentoo 2.42 p3) 2.42.0
ccache version 4.10.1 [enabled]
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.30.2::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.1::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           2.7.18_p16-r2::gentoo, 3.11.10_p1::gentoo, 3.12.6_p2::gentoo
dev-lang/rust:             1.80.1::gentoo
dev-util/ccache:           4.10.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54.2::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/clang:           18.1.8::gentoo
sys-devel/gcc:             11.4.1_p20240501::gentoo, 12.4.0::gentoo, 13.3.1_p20240614::gentoo, 14.2.1_p20240921::gentoo, 15.0.9999::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             18.1.8::gentoo
sys-devel/llvm:            18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.10::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

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

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

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

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

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

tlp
    location: /var/db/repos/localrepo-tlp
    sync-type: git
    sync-uri: https://github.com/dywisor/tlp-portage.git
    sync-user: portage
    masters: gentoo
    volatile: False

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

crossdev
    location: /var/db/repos/localrepo-crossdev
    masters: gentoo
    priority: 10
    volatile: False

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo
    priority: 10
    volatile: False

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -O2 -flto -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -O2 -flto -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
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="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -O2 -flto -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live ccache 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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -O2 -flto -fomit-frame-pointer"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="cs en"
MAKEOPTS="-j16"
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="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acpi activities alsa amd64 amr avif bluetooth bluray branding btrfs bzip2 cairo cdda cdr crypt cups dav1d dbus declarative dri drm dts dvb dvd dvdr egl elogind encode eps exif flac gdbm gif gles gles2 gles3 gpm graphite gsm gtk gtk3 gtk4 gui heif iconv icu jbig jpeg jpeg2k jpegxl kde kf6compat kwallet lcms libnotify libtirpc lto lz4 lzma lzo mad matroska midi mng mount mp3 mp4 mpeg mtp multilib multitarget ncurses networkmanager nls nopic nopie nossp ntfs offensive ogg openexr opengl openh264 openmp opus pam pango pcre pdf pgo pipewire plasma png policykit postscript ppds proprietary-codecs pulseaudio qml qt5 qt6 qt6-imageformats rar rav1e raw readline rtmp sdl semantic-desktop smp sound speex spell split-usr ssl startup-notification svg test-rust tga theora threads tiff timidity truetype udev udisks unicode upower usb v4l vaapi vdpau vkd3d vorbis vpx vtv vulkan wayland webp widevine widgets wmf wxwidgets x264 x265 xcb xft xinerama xml xpm xv xvfb xvid xwayland zlib zstd" ABI_X86="32 64" ADA_TARGET="gcc_12" 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 sha sse sse2 sse3 sse4_1 sse4_2 sse4a 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" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="cs en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="X86 BPF AMDGPU" 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_12 python3_11" QEMU_SOFTMMU_TARGETS="*" QEMU_USER_TARGETS="*" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="amdgpu radeonsi radeon lavapipe" 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, EMERGE_DEFAULT_OPTS, 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 Konstantin Münning 2024-10-05 19:33:20 UTC
Build with -flto -march=k8-sse3 fails the same way so the failure seems to be not only caused by the absence of -march but by the selection of some CPU(s). It may be interesting which (missing) CPU feature is causing the failure so it can be avoided. I did some testing and here the results for some -march settings:

Doesn't work with (error as reported):
x86-64
k8-sse3
athlon64-sse3
amdfam10
core2
corei7-avx

Doesn't work with (different error):
tigerlake
graniterapids

Works with:
native (on zen2=znver2)
znver1
znver2
Comment 2 Konstantin Münning 2024-10-30 15:20:51 UTC
Seems to be fixed upstream, chromium-130.0.6723.58 compiled fine with -march=athlon64-sse3 which didn't work before. I didn't check other -march settings.
Comment 3 Matt Jolly gentoo-dev 2024-11-22 12:15:14 UTC
Hooray, thanks for the update!
Comment 4 Zdenek Sojka 2024-12-05 11:11:38 UTC
(In reply to Konstantin Münning from comment #2)
> Seems to be fixed upstream, chromium-130.0.6723.58 compiled fine with
> -march=athlon64-sse3 which didn't work before. I didn't check other -march
> settings.

I can confirm the same, =www-client/chromium-131.0.6778.85 compiles with -O2 -flto=auto -mtune=native -msse4.1 -mxsave -mcx16 -msahf --param=l1-cache-size=32 --param=l2-cache-size=3072 (where native is core2) without problems. (it just takes a few days) Thank you for your updates!