=sys-libs/efivar-38 surprisingly crashes the linker (GNU ld) when linking libefivar.so. Observed and reproducible on amd64, arm64, and ppc64. The issue does NOT affect =sys-libs/efivar-37 on any arch. emerge --info is from arm64, but the issue seems to be arch-independent. Using =sys-devel/binutils-2.37_p1-r1. Snippet: aarch64-unknown-linux-gnu-gcc -O3 -march=native -mtune=native -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 -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/gcc.specs -fno-merge-constants -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/gcc.specs -fno-merge-constants -L. -O3 -march=native -mtune=native -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 -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/gcc.specs -fno-merge-constants -L. -Wl,-O1 -Wl,--as-needed -O3 -march=native -mtune=native -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,--add-needed -Wl,--build-id -Wl,--no-allow-shlib-undefined -Wl,--no-undefined-version -Wl,-z,now -Wl,-z,muldefs -Wl,-z,relro -Wl,--fatal-warnings -Wl,--add-needed -Wl,--build-id -Wl,--no-allow-shlib-undefined -Wl,--no-undefined-version -Wl,-z,now -Wl,-z,muldefs -Wl,-z,relro -Wl,--fatal-warnings -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/ -shared -Wl,-soname,libefivar.so.1 -Wl,--version-script=libefivar.map \ -T guids.lds \ -o libefivar.so crc32.o dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o efivarfs.o error.o export.o guid.o guid-symbols.o lib.o vars.o time.o -ldl aarch64-unknown-linux-gnu-gcc -O3 -march=native -mtune=native -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 -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/gcc.specs -fno-merge-constants -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/gcc.specs -fno-merge-constants -L. -O3 -march=native -mtune=native -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 -std=gnu11 -funsigned-char -fvisibility=hidden -specs=/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/gcc.specs -fno-merge-constants -L. -Wl,-O1 -Wl,--as-needed -O3 -march=native -mtune=native -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe -Wl,--add-needed -Wl,--build-id -Wl,--no-allow-shlib-undefined -Wl,--no-undefined-version -Wl,-z,now -Wl,-z,muldefs -Wl,-z,relro -Wl,--fatal-warnings -Wl,--add-needed -Wl,--build-id -Wl,--no-allow-shlib-undefined -Wl,--no-undefined-version -Wl,-z,now -Wl,-z,muldefs -Wl,-z,relro -Wl,--fatal-warnings -DLIBEFIVAR_VERSION=38 -D_GNU_SOURCE -I/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/ -shared -Wl,-soname,libefisec.so.1 -Wl,--version-script=libefisec.map \ \ -o libefisec.so sec.o secdb.o esl-iter.o util.o ln -vfs libefisec.so libefisec.so.1 'libefisec.so.1' -> 'libefisec.so' collect2: fatal error: ld terminated with signal 11 [Segmentation fault] compilation terminated. make[1]: *** [/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src/include/rules.mk:39: libefivar.so] Error 1 rm thread-test.o make[1]: Leaving directory '/var/tmp/portage/sys-libs/efivar-38/work/efivar-38/src' make: *** [Makefile:14: all] Error 2 Reproducible: Always Portage 3.0.30 (python 3.9.10-final-0, default/linux/arm64/17.0, gcc-11.2.1, glibc-2.34-r6, 5.15.14-gentoo-dist aarch64) ================================================================= System uname: Linux-5.15.14-gentoo-dist-aarch64-with-glibc2.34 KiB Mem: 15770580 total, 13309704 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Mon, 17 Jan 2022 17:06:49 +0000 Head commit of repository gentoo: 7cb01a9766876475020537e4c2b89952525f7970 sh bash 5.1_p16 ld GNU ld (Gentoo 2.37_p1 p1) 2.37 app-misc/pax-utils: 1.3.3::gentoo app-shells/bash: 5.1_p16::gentoo dev-lang/perl: 5.34.0-r6::gentoo dev-lang/python: 3.9.10::gentoo dev-util/cmake: 3.22.1::gentoo dev-util/meson: 0.60.3::gentoo sys-apps/baselayout: 2.8::gentoo sys-apps/openrc: 0.44.10::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.71-r1::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.37_p1-r1::gentoo sys-devel/binutils-config: 5.4::gentoo sys-devel/gcc: 11.2.1_p20211127::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.16::gentoo (virtual/os-headers) sys-libs/glibc: 2.34-r6::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo sync-user: portage:portage priority: -1000 sync-git-verify-commit-signature: yes lto-overlay location: /var/lib/layman/lto-overlay sync-type: laymansync sync-uri: https://github.com/InBetweenNames/gentooLTO.git masters: gentoo mv priority: 50 matoro location: /var/lib/layman/matoro sync-type: laymansync sync-uri: https://github.com/matoro/overlay.git masters: gentoo 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 nymphos location: /var/lib/layman/nymphos sync-type: laymansync sync-uri: https://github.com/neeshy/nymphos masters: gentoo priority: 50 ACCEPT_KEYWORDS="arm64 ~arm64" ACCEPT_LICENSE="@FREE" CBUILD="aarch64-unknown-linux-gnu" CFLAGS="-O3 -march=native -mtune=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe" CHOST="aarch64-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O3 -march=native -mtune=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=16 -fuse-linker-plugin -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--usepkg --autounmask=n --complete-graph --with-bdeps=y --keep-going" 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="-O2" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live compress-build-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-install pid-sandbox 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" GENTOO_MIRRORS="https://mirror.leaseweb.com/gentoo/ https://mirror.rackspace.com/gentoo/ https://gentoo.osuosl.org/ https://mirrors.rit.edu/gentoo/" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" 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="acl arm64 bash-completion bzip2 caps cli crypt dist-kernel dri elogind fortran gdbm gentoo-vm graphite headless-awt iconv ipv6 libbsd libglvnd libtirpc lm-sensors lto ncurses nls nptl openmp pam pcre pgo readline seccomp split-usr ssl threads udev unicode verify-sig vim-syntax xattr zlib" 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_ARM="aes crc32 edsp sha1 sha2 thumb thumb2 v4 v5 v6 v7 v8 vfp vfp-d32 vfpv3 vfpv4" 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="efi-64" INPUT_DEVICES="libinput" 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" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" 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, 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 ================================================================= Package Settings ================================================================= sys-devel/binutils-2.37_p1-r1::gentoo was built with the following: USE="gold nls plugins (-cet) (-default-gold) -doc -multitarget -static-libs -test -vanilla" CFLAGS="-march=native -pipe -Wl,-O1 -Wl,--as-needed -O2" CXXFLAGS="-march=native -pipe -Wl,-O1 -Wl,--as-needed -O2" FEATURES="ebuild-locks xattr unknown-features-warn usersandbox ipc-sandbox compress-build-logs preserve-libs buildpkg unmerge-logs binpkg-logs userpriv compressdebug merge-sync sfperms config-protect-if-modified multilib-strict userfetch distlocks assume-digests protect-owned unmerge-orphans binpkg-docompress binpkg-dostrip pid-sandbox splitdebug sandbox strict usersync qa-unresolved-soname-deps news fixlafiles parallel-install network-sandbox" LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=native -pipe -O2"
Please try with simpler CFLAGS.
Adding toolchain.
(In reply to Mike Gilbert from comment #1) > Please try with simpler CFLAGS. Oops, looks like it's an LTO thing. Toggling -flto fixes it. Could that be stripped with flag-o-matic please?
(In reply to matoro from comment #3) > Oops, looks like it's an LTO thing. Toggling -flto fixes it. Sounds like a binutils bug.
*** Bug 832190 has been marked as a duplicate of this bug. ***
@dilfridge, can you have a poke?
*** Bug 854495 has been marked as a duplicate of this bug. ***