On my GCC LTO test machine since the clang-15 update I've no longer been able to get libomp to build with the old solution of adding -lm to the LDFLAGS and is now reporting "invalid attempt to declare external version name as default in symbol `ompc_set_affinity_format@@VERSION'" One thing that was brought up on IRC was some of the warnings that using LTO brings possibly not being safe and this does match my own findings that packages like Firefox would fail to build but now I have lto disabled on libomp there is no issue. Note this isn't proven to be cause just seems highly likely. It may be wise to look into using the fliter-lto flag on this ebuild to prevent further strange bugs cropping up in other packages but as this isn't confirmed I'd be happy to offer my test environment with an LTO enabled libomp if given some suggestions of tests which would help. Reproducible: Always Steps to Reproduce: 1. Enable -flto in sys-libs/libomp 2. emerge sys-libs/libomp Actual Results: See build.log Expected Results: Successful build emerge --info Portage 3.0.36 (python 3.10.7-final-0, default/linux/amd64/17.1/desktop, gcc-12.2.0, glibc-2.35-r8, 5.18.18-gentoo-dist x86_64) ================================================================= System uname: Linux-5.18.18-gentoo-dist-x86_64-Intel-R-_Core-TM-_i7-6700K_CPU_@_4.00GHz-with-glibc2.35 KiB Mem: 16349108 total, 8426752 free KiB Swap: 16777212 total, 15823356 free Timestamp of repository gentoo: Sun, 11 Sep 2022 12:30:01 +0000 Head commit of repository gentoo: 8591b592d886d9582286dfd8ce50c2938fae12db Timestamp of repository steam-overlay: Wed, 07 Sep 2022 08:26:00 +0000 Head commit of repository steam-overlay: 78208ca83614c4cc031ca8f8ec9b023a5c9c3b1e sh bash 5.1_p16-r2 ld GNU ld (Gentoo 2.38 p4) 2.38 distcc 3.4 x86_64-pc-linux-gnu [disabled] app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r2::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.36.0::gentoo dev-lang/python: 3.10.7::gentoo, 3.11.0_rc1_p2::gentoo dev-lang/rust: 1.62.1::gentoo dev-util/cmake: 3.24.1::gentoo dev-util/meson: 0.63.2::gentoo sys-apps/baselayout: 2.8-r2::gentoo sys-apps/openrc: 0.45.2::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.13-r2::gentoo, 2.71-r2::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.38-r2::gentoo, 2.39-r2::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/clang: 14.0.6-r1::gentoo, 15.0.0::gentoo sys-devel/gcc: 12.2.0::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/lld: 14.0.6::gentoo sys-devel/llvm: 14.0.6-r2::gentoo, 15.0.0::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.19::gentoo (virtual/os-headers) sys-libs/glibc: 2.35-r8::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: https://github.com/gentoo-mirror/gentoo.git priority: -1000 sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: cinnamon location: /var/db/repos/cinnamon masters: gentoo steam-overlay location: /var/db/repos/steam-overlay sync-type: git sync-uri: https://github.com/gentoo-mirror/steam-overlay.git masters: gentoo ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -fgraphite-identity -floop-nest-optimize -flto=8 -fuse-linker-plugin -falign-functions=32" 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 -O2 -pipe -fgraphite-identity -floop-nest-optimize -flto=8 -fuse-linker-plugin -falign-functions=32" DISTDIR="/var/cache/distfiles" 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="-march=native -O2 -pipe -fgraphite-identity -floop-nest-optimize -flto=8 -fuse-linker-plugin -falign-functions=32" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live 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 qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=native -O2 -pipe -fgraphite-identity -floop-nest-optimize -flto=8 -fuse-linker-plugin -falign-functions=32" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j8" 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 acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cli crypt cups d3d9 dbus dist-kernel dri dts dvd dvdr elogind encode evdev exif flac fortran gdbm gif gpm graphite gtk gtk3 gui iconv icu introspection ipv6 jpeg lcms libglvnd libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf pgo png policykit ppds pulseaudio readline sdl seccomp spell split-usr ssl startup-notification svg tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis vulkan vulkan-overlay wxwidgets x264 xattr xcb xinerama xml xv xvid zlib" ABI_X86="64 32" ADA_TARGET="gnat_2020" 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="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 ssse3" 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" INPUT_DEVICES="lininput evdev joystick" KERNEL="linux" L10N="en en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="i386 ppc ppc64 riscv32 riscv64 x86_64" QEMU_USER_TARGETS="i386 ppc ppc64 riscv32 riscv64 x86_64" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="nvidia intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat 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, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Created attachment 805126 [details] build.log
Created attachment 805129 [details] envionment
Seems the GentooLTO community have run into this issue as well much earlier and are filtering out -flto on their packages. https://github.com/InBetweenNames/gentooLTO/blob/master/sys-config/ltoize/files/package.cflags/lto.conf#L95
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fa5bec5df273399c01c263bc3881f50ce0b2736 commit 1fa5bec5df273399c01c263bc3881f50ce0b2736 Author: Ian Jordan <immoloism@gmail.com> AuthorDate: 2022-09-27 21:56:25 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-27 22:21:00 +0000 sys-libs/libomp: filter LTO Filter LTO on sys-libs/libomp as it causes strange issues on the system like Firefox not building. Closes: https://github.com/gentoo/gentoo/pull/27502 Closes: https://bugs.gentoo.org/870127 Signed-off-by: Ian Jordan <immoloism@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> sys-libs/libomp/libomp-13.0.1.ebuild | 4 +++- sys-libs/libomp/libomp-14.0.6-r1.ebuild | 4 +++- sys-libs/libomp/libomp-15.0.1.ebuild | 4 +++- sys-libs/libomp/libomp-15.0.2.9999.ebuild | 4 +++- sys-libs/libomp/libomp-16.0.0.9999.ebuild | 4 +++- sys-libs/libomp/libomp-16.0.0_pre20220918.ebuild | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-)
Now it also has -Werror=odr violations in version 20
Created attachment 920226 [details] build.log
Please report that upstream. Thanks.