Created attachment 825159 [details] build.log src_install() is not supposed to be compiling or linking any object files, but sys-fs/lvm2-2.03.14-r3 is compiling libdm/dm-tools/dmsetup.o and linking libdm/dm-tools/dmsetup in the ebuild install phase. See the attached build.log. Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/amd64/17.1/no-multilib/prefix/kernel-3.2+, gcc-11.3.0, glibc-2.35-r8, 5.15.74-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-5.15.74-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-glibc2.35 KiB Mem: 8153232 total, 256852 free KiB Swap: 12582908 total, 5800904 free Timestamp of repository gentoo: Sun, 23 Oct 2022 10:30:01 +0000 Head commit of repository gentoo: 2c36cc4b3a24cfb2220dd2c7b5a520d95e64d7b0 sh bash 5.1_p16-r1 ld GNU gold (Gentoo 2.38 p4 2.38) 1.16 app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r1::gentoo dev-lang/perl: 5.34.1-r3::gentoo dev-lang/python: 3.10.8::gentoo dev-util/meson: 0.62.2::gentoo sys-apps/baselayout: 2.8::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.38-r2::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/gcc: 11.3.0::gentoo sys-devel/gcc-config: 2.5-r1::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.15-r3::gentoo (virtual/os-headers) sys-libs/glibc: 2.35-r8::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-jobs: 1 sync-rsync-verify-metamanifest: no sync-rsync-verify-max-age: 24 local location: /var/db/repos/local masters: gentoo priority: 1000 ACCEPT_KEYWORDS="amd64 amd64-linux" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -Os -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -Os -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--nospinner --unordered-display" 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 XDG_STATE_HOME" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox multilib-strict network-sandbox news nodoc noinfo noman parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv" FFLAGS="-O2 -pipe" GENTOO_MIRRORS=" http://mirror.leaseweb.com/gentoo/ http://mirrors.rit.edu/gentoo/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ " INSTALL_MASK="/etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/sysusers.d /usr/share/bash-completion /usr/share/cmake/Help /usr/share/gtk-doc /usr/share/locale/*/ -/usr/share/locale/en -/usr/share/locale/en_US" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O2 -Wl,--as-needed" LINGUAS="en_US en" MAKEOPTS="-j5 -l8" PKGDIR="/var/cache/binpkgs" PORTAGE_COMPRESS="xz" 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="amd64 cli crypt dri ipv6 libglvnd libtirpc ncurses nptl prefix readline seccomp split-usr ssl test-rust unicode" ABI_X86="64" ADA_TARGET="gnat_2020" ALSA_CARDS="hda-intel" 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 sse3 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="evdev" KERNEL="linux" L10N="en-US en" 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-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" 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, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS ================================================================= Package Settings ================================================================= sys-fs/lvm2-2.03.14-r3::gentoo was built with the following: USE="device-mapper-only (prefix) readline -lvm2create-initrd -sanlock (-selinux) -static -static-libs (-systemd) -thin -udev" LDFLAGS="-Wl,-O2 -Wl,--as-needed -fuse-ld=bfd"
This issue seems to be related to a race condition I am seeing on my system where the following error is raised by gcc: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../lib64/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:61: dmsetup] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-fs/lvm2-2.03.14-r3/work/LVM2.2.03.14/libdm/dm-tools' make[1]: *** [../libdm/make.tmpl:317: dm-tools.device-mapper] Error 2 In my case using MAKEOPTS="-j1" solves the issue.
Probably related to USE=device-mapper-only.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=adfd6d40a22310df2b4c048d84d80ddfda7d1a4c commit adfd6d40a22310df2b4c048d84d80ddfda7d1a4c Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2022-10-26 18:10:04 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2022-10-26 18:11:13 +0000 sys-fs/lvm2: work around faulty device-mapper target Bug: https://bugs.gentoo.org/878131 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-fs/lvm2/lvm2-2.03.14-r3.ebuild | 2 ++ 1 file changed, 2 insertions(+)
I would like to leave this bug open until we get this fixed upstream.
(In reply to Francisco Blas Izquierdo Riera from comment #1) > This issue seems to be related to a race condition I am seeing on my system > where the following error is raised by gcc: > /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ > ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../lib64/Scrt1.o: in > function `_start': > (.text+0x17): undefined reference to `main' > collect2: error: ld returned 1 exit status > make[2]: *** [Makefile:61: dmsetup] Error 1 I too encountered this same link failure, and it's what led me to notice the stray compilation in the install phase. I was unable to reproduce the failure, so I did not mention it in my bug report.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce4a096fd6727f2f34330e3edf3de409fccc8dab commit ce4a096fd6727f2f34330e3edf3de409fccc8dab Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2022-10-27 20:41:37 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2022-10-27 20:41:37 +0000 sys-fs/lvm2: work around faulty device-mapper target Bug: https://bugs.gentoo.org/878131 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-fs/lvm2/lvm2-2.03.16.ebuild | 2 ++ 1 file changed, 2 insertions(+)
Hi Mike! Just wanted to mention that I cannot reproduce the race condition with sys-fs/lvm2-2.03.14-r4[-lvm] (I know you still want to wait for upstream to fix this but it may be useful for other looking for a solution too). Thanks for your great work!