Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 818445 - dev-ml/findlib: broken with LTO (temp/ccegTFvT.ltrans2.ltrans.o:(.debug_info+0x8ce8): undefined reference to `io.c.880cdbd1')
Summary: dev-ml/findlib: broken with LTO (temp/ccegTFvT.ltrans2.ltrans.o:(.debug_info+...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Team for the ML programming language family
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2021-10-16 09:42 UTC by Ladislav Zitka
Modified: 2022-03-14 20:31 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,941.75 KB, text/plain)
2021-10-16 09:45 UTC, Ladislav Zitka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ladislav Zitka 2021-10-16 09:42:26 UTC
I cannot build stable neither unstable version of findlib.

The only specific thing I use LTO optimization from gentoo overlay:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-11.2.0/work/gcc-11.2.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/11.2.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/python --enable-languages=c,c++,go,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=yes --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 11.2.0 p1' --disable-esp --enable-libstdcxx-time --with-build-config=bootstrap-lto --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --enable-lto --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Gentoo 11.2.0 p1)
Comment 1 Ladislav Zitka 2021-10-16 09:43:37 UTC
eus /etc/portage/package.use # emerge --info
Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1, gcc-11.2.0, glibc-2.33-r1, 5.13.10-gentoo-x86_64 x86_64)
=================================================================
System uname: Linux-5.13.10-gentoo-x86_64-x86_64-Intel-R-_Xeon-R-_CPU_E5-2697_v4_@_2.30GHz-with-glibc2.33
KiB Mem:   131390160 total,  52144580 free
KiB Swap:   63963132 total,  63963132 free
Timestamp of repository gentoo: Sat, 16 Oct 2021 08:30:01 +0000
Head commit of repository gentoo: b6c8a07a49cd0bfe6e0e83065d72d06576f5e217
Head commit of repository steam-overlay: bcdf7b7b1ffb3058a0d924e849a5abf18f364d9c

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
distcc 3.4 x86_64-pc-linux-gnu [disabled]
ccache version 4.3 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r2::gentoo
dev-lang/python:          2.7.18_p13::gentoo, 3.8.12::gentoo, 3.9.6_p2::gentoo
dev-lang/rust:            1.53.0::gentoo
dev-util/ccache:          4.3-r3::gentoo
dev-util/cmake:           3.21.3::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.43.5-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.4::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            11.2.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

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

2xsaiko
    location: /var/lib/layman/2xsaiko
    sync-type: laymansync
    sync-uri: https://git.sr.ht/~dblsaiko/ebuilds
    masters: gentoo
    priority: 50

alesharik
    location: /var/lib/layman/alesharik
    sync-type: laymansync
    sync-uri: https://github.com/alesharik/alesharik-overlay.git
    masters: gentoo
    priority: 50

archenroot
    location: /var/lib/layman/archenroot
    sync-type: laymansync
    sync-uri: https://github.com/archenroot/gentoo-overlay.git
    masters: gentoo
    priority: 50

guru
    location: /var/lib/layman/guru
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru.git
    masters: gentoo
    priority: 50

lto-overlay
    location: /var/lib/layman/lto-overlay
    sync-type: laymansync
    sync-uri: https://github.com/InBetweenNames/gentooLTO.git
    masters: gentoo mv
    priority: 50

mv
    location: /var/lib/layman/mv
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/user/mv.git
    masters: gentoo
    priority: 50

nest
    location: /var/lib/layman/nest
    sync-type: laymansync
    sync-uri: https://github.com/SpiderX/portage-overlay.git
    masters: gentoo
    priority: 50

phackerlay
    location: /var/lib/layman/phackerlay
    sync-type: laymansync
    sync-uri: https://gitlab.phys-el.ru/ustinov/phackerlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /usr/local/portage/steam-overlay
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

stuff
    location: /var/lib/layman/stuff
    sync-type: laymansync
    sync-uri: https://github.com/istitov/stuff.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf"
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="-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe"
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="-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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="-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j12 -l12"
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"
USE="X acl alsa amd64 bluetooth bzip2 cli crypt dbus dri elogind fortran fuse gdbm gentoo-vm iconv initramfs ipv6 libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre policykit pulseaudio readline seccomp split-usr ssl tcpd udev udisks unicode wayland xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2019" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="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 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="emu efi-32 efi-64 pc" INPUT_DEVICES="libinput synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="nvidia" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-16 09:44:48 UTC
Can you uplod the full build.log please?
Comment 3 Ladislav Zitka 2021-10-16 09:45:55 UTC
Created attachment 745122 [details]
build.log

I deleted some repeated lines to prevent upload limit size.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-16 09:47:18 UTC
(In reply to Ladislav Jech from comment #3)
> Created attachment 745122 [details]
> build.log
> 
> I deleted some repeated lines to prevent upload limit size.

Can you attach the full one compressed please?

Anyway, this does indeed look totally broken with LTO. Please try -fno-lto with it. You may need to recompile dev-ml/* and dev-lang/ocaml with it too.
Comment 5 Ladislav Zitka 2021-10-16 09:53:13 UTC
I cannot build stable neither unstable version of findlib.

The only specific thing I use LTO optimization from gentoo overlay:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-11.2.0/work/gcc-11.2.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/11.2.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/11.2.0/python --enable-languages=c,c++,go,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=yes --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 11.2.0 p1' --disable-esp --enable-libstdcxx-time --with-build-config=bootstrap-lto --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --enable-lto --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Gentoo 11.2.0 p1)
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-16 09:54:22 UTC
(In reply to Ladislav Jech from comment #5)
> I cannot build stable neither unstable version of findlib.
> 

You seem to have posted the same comment again
Comment 7 Ladislav Zitka 2021-10-16 09:58:41 UTC
Yeah, sorry, my bad. Its shame I cannot delete message/edit.

I will try without lto, in meanwhile I opened the bug at:
https://github.com/InBetweenNames/gentooLTO/issues/792
and upstream:
https://github.com/ocaml/ocamlfind/issues/24
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-16 09:59:39 UTC
(In reply to Ladislav Jech from comment #7)
> Yeah, sorry, my bad. Its shame I cannot delete message/edit.
> 
> I will try without lto, in meanwhile I opened the bug at:
> https://github.com/InBetweenNames/gentooLTO/issues/792
> and upstream:
> https://github.com/ocaml/ocamlfind/issues/24

Based on https://github.com/ocaml/ocaml/issues/9825 (which is in your log too), I think this is fixed in >= OCaml 4.12. Can you try that?
Comment 9 Ladislav Zitka 2021-10-16 10:11:42 UTC
Just trying to compile, but without LTO wasn't enough:
 Emerging (1 of 1) dev-ml/findlib-1.9.1::gentoo
 * findlib-1.9.1.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                       [ ok ]
 * /etc/portage/package.cflags/lto.conf -> dev-ml/*: *FLAGS-=-flto*
 * FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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'
 * CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * CXXFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * FFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * FCFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * F77FLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'
 * LDFLAGS='-Wl,-O1 -Wl,--as-needed'
 * MAKEOPTS='-j12 -l12'
 * gcc (Gentoo 11.2.0 p1) 11.2.0
 * g++ (Gentoo 11.2.0 p1) 11.2.0
 * GNU ld (Gentoo 2.37_p1 p0) 2.37
 * Linux zeus 5.13.10-gentoo-x86_64 #2 SMP Sat Oct 9 11:39:47 CEST 2021 x86_64 Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz GenuineIntel GNU/Linux

I will try to disable all optimizations from lto overlay
Comment 10 Ladislav Zitka 2021-10-16 10:13:08 UTC
I have 4.12.1 version installed.
Comment 11 Larry the Git Cow gentoo-dev 2021-10-16 10:14:50 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04eb86bc87e3a854927784268005115f021188bc

commit 04eb86bc87e3a854927784268005115f021188bc
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-16 10:14:26 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-16 10:14:26 +0000

    dev-lang/ocaml: filter LTO, no strict aliasing in <4.12
    
    Bug: https://bugs.gentoo.org/818445
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/ocaml/ocaml-4.05.0-r7.ebuild | 5 +++++
 dev-lang/ocaml/ocaml-4.05.0-r8.ebuild | 5 +++++
 dev-lang/ocaml/ocaml-4.09.0-r2.ebuild | 5 +++++
 dev-lang/ocaml/ocaml-4.10.2-r2.ebuild | 5 +++++
 dev-lang/ocaml/ocaml-4.11.2-r2.ebuild | 5 +++++
 5 files changed, 25 insertions(+)
Comment 12 Ladislav Zitka 2021-10-16 10:17:47 UTC
So there are multiple places of optimizations pulled by gentoo lto overlay:
zeus /etc/portage/package.cflags # ls -la
total 56
drwxr-xr-x  2 root root 4096 Aug 12 21:24 .
drwxr-xr-x 12 root root 4096 Sep 13 10:41 ..
lrwxrwxrwx  1 root root   86 Aug 12 21:24 cmake-makefile.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/cmake-makefile.conf
lrwxrwxrwx  1 root root   94 Aug 12 21:24 devirtualize-at-ltrans.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/devirtualize-at-ltrans.conf
lrwxrwxrwx  1 root root   80 Aug 12 21:24 graphite.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/graphite.conf
lrwxrwxrwx  1 root root   79 Aug 12 21:24 ipa-pta.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/ipa-pta.conf
lrwxrwxrwx  1 root root   75 Aug 12 21:24 lto.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/lto.conf
lrwxrwxrwx  1 root root   89 Aug 12 21:24 no-common-libtool.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/no-common-libtool.conf
lrwxrwxrwx  1 root root   78 Aug 12 21:24 no-plt.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/no-plt.conf
lrwxrwxrwx  1 root root   97 Aug 12 21:24 no-semantic-interposition.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/no-semantic-interposition.conf
lrwxrwxrwx  1 root root   85 Aug 12 21:24 optimizations.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/optimizations.conf
lrwxrwxrwx  1 root root   89 Aug 12 21:24 portage-bashrc-mv.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/portage-bashrc-mv.conf
lrwxrwxrwx  1 root root   83 Aug 12 21:24 tls-dialect.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/tls-dialect.conf
lrwxrwxrwx  1 root root   78 Aug 12 21:24 use-ld.conf -> /var/lib/layman/lto-overlay/sys-config/ltoize/files/package.cflags/use-ld.conf

I just disabled dev-ml/findlib in:
ipa-pta.conf
lto.conf

but its not enough. Please not dev-lang/ocaml is already in ipa-pta.conf
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-16 10:19:17 UTC
The issue in the bug I linked (which seems identical to yours) is caused by strict aliasing (which is enabled at -O3). You can try -fno-strict-aliasing to see if it helps.

I think LTO may just exacerbate it.
Comment 14 Ladislav Zitka 2021-10-16 10:26:23 UTC
CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -fdevirtualize-at-ltrans -fno-semantic-interposition -fuse-linker-plugin -fno-strict-aliasing -pipe -Wl,-O1 -Wl,--as-needed'

still failing.
Comment 15 Ladislav Zitka 2021-10-16 10:26:46 UTC
maybe do I need to rebuild also dev-lang/ocaml?
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-16 10:27:08 UTC
(In reply to Ladislav Jech from comment #15)
> maybe do I need to rebuild also dev-lang/ocaml?

Yeah, try that please, and share the log from findlib if it fails again?
Comment 17 Ladislav Zitka 2021-10-16 10:35:12 UTC
Ok, it builds just fine after ocaml recompile and with these flags:
 * FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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'
 * CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -fdevirtualize-at-ltrans -fno-semantic-interposition -fno-strict-aliasing -pipe -Wl,-O1 -Wl,--as-neede
Comment 18 Ladislav Zitka 2021-10-16 10:40:31 UTC
Its bit different now, I can build again with all optimizations enabled:
 FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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'
 * CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed

but I had to lower down dev-lang/ocaml optmizations:
lto.conf:dev-lang/ocaml *FLAGS-=-flto* *FLAGS-=-O3* *FLAGS-=-fuse-linker-plugin*
ipa-pta.conf:dev-lang/ocaml *FLAGS-="${IPAPTA}" # ICE during IPA pass: pta in lto1: Segmentation fault
graphite.conf:dev-lang/ocaml *FLAGS-="${GRAPHITE}"
Comment 19 Ladislav Zitka 2021-10-16 11:04:26 UTC
thank you for assitance, not sure if we should or not close it, both ocaml and findlibs are now emerged with following cflags:
dev-lang/ocaml
* /etc/portage/package.cflags/lto.conf -> dev-lang/ocaml: *FLAGS-=-flto* *FLAGS-=-O3* *FLAGS-=-fuse-linker-plugin*
 * /etc/portage/package.cflags/ipa-pta.conf -> dev-lang/ocaml: *FLAGS-="${IPAPTA}" # ICE during IPA pass: pta in lto1: Segmentation fault
 * /etc/portage/package.cflags/graphite.conf -> dev-lang/ocaml: *FLAGS-="${GRAPHITE}"
 * FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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'
 * CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -fdevirtualize-at-ltrans -fno-semantic-interposition -pipe -Wl,-O1 -Wl,--as-needed'

dev-ml/findlib
* FEATURES='assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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'
 * CFLAGS='-Wno-error=format-overflow -falign-functions=32 -march=broadwell -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed'

do you think I should report it upstream?
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-16 22:15:43 UTC
I think it's already fixed upstream (see the bug I linked) but only in newer OCamls. I've added filtering to the ebuild too and I think it should be OK now.