Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 910487 - sys-block/parted: underlinked against util-linux (=sys-libs/libblockdev-3.0.1: error: undefined reference due to --no-allow-shlib-undefined: uuid_generate)
Summary: sys-block/parted: underlinked against util-linux (=sys-libs/libblockdev-3.0.1...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: PATCH, PullRequest
: 925172 (view as bug list)
Depends on:
Blocks: LD-is-lld, systemwide-lld
  Show dependency tree
 
Reported: 2023-07-18 12:43 UTC by David Carlos Manuelda
Modified: 2024-04-24 06:24 UTC (History)
9 users (show)

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


Attachments
emerge --info (emerge.txt,21.17 KB, text/plain)
2023-07-18 12:43 UTC, David Carlos Manuelda
Details
build.log (build.log,145.28 KB, text/x-log)
2023-07-18 12:44 UTC, David Carlos Manuelda
Details
lld-built-libblockdev (libblockdev-3.0.2-r1-lld.log,210.09 KB, text/x-log)
2023-08-29 07:27 UTC, unhappy-ending
Details
libblockdev-3.0.1-lld.log (libblockdev-3.0.1-lld.log,148.99 KB, text/x-log)
2023-08-29 08:29 UTC, unhappy-ending
Details
musl build.log (build.log,144.56 KB, text/plain)
2023-12-18 00:04 UTC, Christopher Fore
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlos Manuelda 2023-07-18 12:43:02 UTC
This is a llvm profile with lld as linker (not sure if it's related), will attach emerge --info and build.log
Comment 1 David Carlos Manuelda 2023-07-18 12:43:47 UTC
Created attachment 865715 [details]
emerge --info
Comment 2 David Carlos Manuelda 2023-07-18 12:44:54 UTC
Created attachment 865716 [details]
build.log
Comment 3 Stuart Meya 2023-08-09 23:33:40 UTC
Hello,

I experience this problem in 3.0.2 also. Profile is LLVM/systemd on arm64/aarch64.

emerge --info '=sys-libs/libblockdev-3.0.2::gentoo': https://0x0.st/H_OF.2::gento

emerge -pqv '=sys-libs/libblockdev-3.0.2::gentoo':  http://0x0.st/H_OC.2::gento

/var/tmp/portage/sys-libs/libblockdev-3.0.2/temp/build.log: http://0x0.st/H_Vr.log


Greetings
Comment 4 Stuart Meya 2023-08-09 23:35:44 UTC
Just check and with GCC fallback it builds without problems, so it's really a LLVM/Clang thing.

My env/compiler-gcc:

COMMON_FLAGS="-O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
LDFLAGS="-Wl,--as-needed"

CC="gcc"
CXX="g++"

AR="${CHOST}-ar"
NM="${CHOST}-nm"
RANLIB="${CHOST}-ranlib"
Comment 5 David Carlos Manuelda 2023-08-09 23:40:59 UTC
(In reply to Stuart Meya from comment #4)
> Just check and with GCC fallback it builds without problems, so it's really
> a LLVM/Clang thing.
> 
> My env/compiler-gcc:
> 
> COMMON_FLAGS="-O2 -pipe"
> CFLAGS="${COMMON_FLAGS}"
> CXXFLAGS="${COMMON_FLAGS}"
> LDFLAGS="-Wl,--as-needed"
> 
> CC="gcc"
> CXX="g++"
> 
> AR="${CHOST}-ar"
> NM="${CHOST}-nm"
> RANLIB="${CHOST}-ranlib"

In fact it is only a problem of LLD linker, since I could compile with clang but using BFD as linker via /etc/portage/package.env file
Comment 6 Stuart Meya 2023-08-10 00:19:18 UTC
(In reply to David Carlos Manuelda from comment #5)
> (In reply to Stuart Meya from comment #4)
> > Just check and with GCC fallback it builds without problems, so it's really
> > a LLVM/Clang thing.
> > 
> > My env/compiler-gcc:
> > 
> > COMMON_FLAGS="-O2 -pipe"
> > CFLAGS="${COMMON_FLAGS}"
> > CXXFLAGS="${COMMON_FLAGS}"
> > LDFLAGS="-Wl,--as-needed"
> > 
> > CC="gcc"
> > CXX="g++"
> > 
> > AR="${CHOST}-ar"
> > NM="${CHOST}-nm"
> > RANLIB="${CHOST}-ranlib"
> 
> In fact it is only a problem of LLD linker, since I could compile with clang
> but using BFD as linker via /etc/portage/package.env file

You're right! Thank you, tried it and it worked flawlessly.
Comment 7 Larry the Git Cow gentoo-dev 2023-08-19 16:24:25 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=199a157b43188adb4e2da3f0d285a7a6a351ea44

commit 199a157b43188adb4e2da3f0d285a7a6a351ea44
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2023-08-19 11:40:46 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2023-08-19 16:24:07 +0000

    sys-libs/libblockdev: work around problems with sys-devel/lld
    
    Closes: https://bugs.gentoo.org/910487
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 sys-libs/libblockdev/libblockdev-3.0.2-r1.ebuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Comment 8 unhappy-ending 2023-08-29 07:27:30 UTC
Created attachment 868958 [details]
lld-built-libblockdev

Hi, sorry to comment on a closed bug, but I'm not having this problem on a LLVM toolchain based system.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-29 07:32:17 UTC
I don't think that means much unless you can investigate why. It's possible that references get pruned out with different settings so the unresolved ones don't matter.
Comment 10 unhappy-ending 2023-08-29 08:29:44 UTC
Created attachment 868973 [details]
libblockdev-3.0.1-lld.log

How do I investigate this? I've downloaded the old 3.0.1.ebuild from the github and recompiled. I changed all my FEATURES, USE, and CFLAGS to be identical to OPs and I'm still not having this problem. The link that fails for OP doesn't fail for me, and the flag -Wl,--no-undefined is passed so it would fail if the symbol was unresolved.

Let me know what I can do to investigate and I'll give it a shot.
Comment 11 unhappy-ending 2023-08-29 08:34:03 UTC
emerge --info libblockdev
Portage 3.0.49 (python 3.11.4-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.38-r1, 6.1.39-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.39-gentoo-dist-x86_64-AMD_Ryzen_9_3950X_16-Core_Processor-with-glibc2.38
KiB Mem:    32767532 total,  27512040 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 25 Aug 2023 04:01:43 +0000
Head commit of repository gentoo: 0a98e35d98ec924349bee8526508d8c9da3b824a

Head commit of repository audio-overlay: 55b54954e39915ef48223eccac48fbc19f64f359

Head commit of repository brave-overlay: c7da04f0ca99a42170683bf9a787e5a52d917582

Head commit of repository cg: 54d9dc8edba6dc0053a98d5a3419ac4aa05ac1a9

Head commit of repository guru: 6cff2aa10f74444623f7a64f2abb046056355ba9

Head commit of repository src_prepare-overlay: 10410ebf15a4acdf57521a0fddfa8b7d6dda39e7

Head commit of repository steam-overlay: bcbce9c5c716ed52d7d8b3bca0b90bf47193310a

sh bash 5.2_p15-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
ccache version 4.8.2 [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r6::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.4::gentoo
dev-lang/rust:             1.70.0::gentoo
dev-util/ccache:           4.8.2::gentoo
dev-util/cmake:            3.27.1-r1::gentoo
dev-util/meson:            1.2.0::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          254-r2::gentoo
sys-devel/autoconf:        2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r6::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo
sys-devel/gcc:             12.3.1_p20230623::gentoo, 13.1.1_p20230527::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.4::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r1::gentoo
Repositories:

gentoo
    location: /etc/portage/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: 0
    eclass-overrides: unhappy-ending
    volatile: True

audio-overlay
    location: /etc/portage/repos/audio-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-audio/audio-overlay.git
    masters: gentoo
    priority: 50
    eclass-overrides: audio-overlay
    volatile: True

brave-overlay
    location: /etc/portage/repos/brave-overlay
    sync-type: git
    sync-uri: https://gitlab.com/jason.oliveira/brave-overlay.git
    masters: gentoo
    priority: 50
    eclass-overrides: brave-overlay
    volatile: True

cg
    location: /etc/portage/repos/cg
    sync-type: git
    sync-uri: https://github.com/brothermechanic/cg
    masters: gentoo
    priority: 50
    eclass-overrides: cg
    volatile: True

guru
    location: /etc/portage/repos/guru
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru
    masters: gentoo
    priority: 50
    eclass-overrides: guru
    volatile: True

src_prepare-overlay
    location: /etc/portage/repos/src_prepare-overlay
    sync-type: git
    sync-uri: https://gitlab.com/src_prepare/src_prepare-overlay.git
    masters: gentoo
    priority: 50
    eclass-overrides: src_prepare-overlay
    volatile: True

steam-overlay
    location: /etc/portage/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay
    masters: gentoo
    priority: 50
    eclass-overrides: steam-overlay
    volatile: True

unhappy-ending
    location: /etc/portage/repos/unhappy-ending
    masters: gentoo
    priority: 100
    eclass-overrides: unhappy-ending
    volatile: True

Installed sets: @desktop-apps, @dev-qt, @kde-frameworks, @kde-plasma, @production-video, @steam-client, @steam-runtime, @system-hardware, @system-kernel, @system-tools, @toolchain-llvm
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver2 -O3 -pipe -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/modprobe.d /etc/portage/savedconfig /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"
CXXFLAGS="-march=znver2 -O3 -pipe -flto -stdlib=libc++"
DISTDIR="/etc/portage/package.distfiles"
EMERGE_DEFAULT_OPTS="-a -j8 -l8 --alphabetical --autounmask=n --columns --quiet-build --quiet-unmerge-warn"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live candy ccache config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org /etc/portage/package.mirrors"
LANG="en_US.utf8"
LDFLAGS=" -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--threads=8"
LEX="flex"
LINGUAS="*"
MAKEOPTS="-j8 -l8"
PKGDIR="/etc/portage/package.distfiles/bin"
PORTAGE_BINHOST="https://calculate.mirror.garr.it/grp/x86_64"
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="/etc/portage/package.tmp"
RUSTFLAGS="-C debuginfo=0 -C linker=clang -C linker-plugin-lto -C opt-level=3 -C panic=unwind -C strip=symbols -C target-cpu=znver2 -C link-arg=-fuse-ld=lld -C link-arg=-Wl,--as-needed -C link-arg=-Wl,--icf=all -C link-arg=-Wl,--threads=8 -C link-arg=-Wl,-O2 -C link-arg=-Wl,-z,now -C link-arg=-Wl,-z,relro"
SHELL="/bin/bash"
USE="acl aes amd64 avx avx2 bzip2 cli crypt dri f16c fma3 fortran gdbm iconv ipv6 libtirpc mmx mmxext multilib ncurses nls nptl openmp pam pclmul pcre popcnt rdrand readline seccomp sha split-usr sse sse2 sse3 sse4_1 sse4_2 sse4a ssl ssse3 test-rust unicode xattr zlib" ABI_X86="32 64" ADA_TARGET="gnat_2021" CALLIGRA_FEATURES="karbon sheets words" 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" INPUT_DEVICES="libinput wacom" KERNEL="linux" L10N="*" LLVM_TARGETS="BPF NVPTX X86" LUA_SINGLE_TARGET="lua5-4" LUA_TARGETS="lua5-1" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="nvidia"
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, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

sys-libs/libblockdev-3.0.1::unhappy-ending was built with the following:
USE="-cryptsetup device-mapper -escrow -gtk-doc introspection -lvm nvme -test tools" ABI_X86="(64)" PYTHON_SINGLE_TARGET="-python3_10 python3_11"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live candy 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 split-log strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
Comment 12 unhappy-ending 2023-08-29 08:38:30 UTC
Sorry, wrong emerge --info. That was from another chroot. Here's from the one used for the build log.

emerge --info libblockdev
Portage 3.0.49 (python 3.11.4-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.38-r1, 6.1.39-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.39-gentoo-dist-x86_64-AMD_Ryzen_9_3950X_16-Core_Processor-with-glibc2.38
KiB Mem:    32767532 total,  27510228 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 25 Aug 2023 04:01:43 +0000
Head commit of repository gentoo: 0a98e35d98ec924349bee8526508d8c9da3b824a

Head commit of repository audio-overlay: 55b54954e39915ef48223eccac48fbc19f64f359

Head commit of repository brave-overlay: c7da04f0ca99a42170683bf9a787e5a52d917582

Head commit of repository cg: 54d9dc8edba6dc0053a98d5a3419ac4aa05ac1a9

Head commit of repository guru: 6cff2aa10f74444623f7a64f2abb046056355ba9

Head commit of repository src_prepare-overlay: 10410ebf15a4acdf57521a0fddfa8b7d6dda39e7

Head commit of repository steam-overlay: bcbce9c5c716ed52d7d8b3bca0b90bf47193310a

sh bash 5.2_p15-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
ccache version 4.8.2 [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r6::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.4::gentoo
dev-lang/rust:             1.70.0::gentoo
dev-util/ccache:           4.8.2::gentoo
dev-util/cmake:            3.27.1-r1::gentoo
dev-util/meson:            1.2.0::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-apps/systemd:          254-r2::gentoo
sys-devel/autoconf:        2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r6::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.6::gentoo
sys-devel/gcc:             12.3.1_p20230623::gentoo, 13.1.1_p20230527::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.6::gentoo
sys-devel/llvm:            16.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.4::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r1::gentoo
Repositories:

gentoo
    location: /etc/portage/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: 0
    eclass-overrides: unhappy-ending
    volatile: True

audio-overlay
    location: /etc/portage/repos/audio-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-audio/audio-overlay.git
    masters: gentoo
    priority: 50
    eclass-overrides: audio-overlay
    volatile: True

brave-overlay
    location: /etc/portage/repos/brave-overlay
    sync-type: git
    sync-uri: https://gitlab.com/jason.oliveira/brave-overlay.git
    masters: gentoo
    priority: 50
    eclass-overrides: brave-overlay
    volatile: True

cg
    location: /etc/portage/repos/cg
    sync-type: git
    sync-uri: https://github.com/brothermechanic/cg
    masters: gentoo
    priority: 50
    eclass-overrides: cg
    volatile: True

guru
    location: /etc/portage/repos/guru
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru
    masters: gentoo
    priority: 50
    eclass-overrides: guru
    volatile: True

src_prepare-overlay
    location: /etc/portage/repos/src_prepare-overlay
    sync-type: git
    sync-uri: https://gitlab.com/src_prepare/src_prepare-overlay.git
    masters: gentoo
    priority: 50
    eclass-overrides: src_prepare-overlay
    volatile: True

steam-overlay
    location: /etc/portage/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay
    masters: gentoo
    priority: 50
    eclass-overrides: steam-overlay
    volatile: True

unhappy-ending
    location: /etc/portage/repos/unhappy-ending
    masters: gentoo
    priority: 100
    eclass-overrides: unhappy-ending
    volatile: True

Installed sets: @desktop-apps, @dev-qt, @kde-frameworks, @kde-plasma, @production-video, @steam-client, @steam-runtime, @system-hardware, @system-kernel, @system-tools, @toolchain-llvm
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="llvm-as"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=znver2 -O3 -pipe -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/modprobe.d /etc/portage/savedconfig /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"
CPP="clang-cpp"
CXX="clang++"
CXXFILT="llvm-cxxfilt"
CXXFLAGS="-march=znver2 -O3 -pipe -flto -stdlib=libc++"
DISTDIR="/etc/portage/package.distfiles"
EMERGE_DEFAULT_OPTS="-a -j8 -l8 --alphabetical --autounmask=n --columns --quiet-build --quiet-unmerge-warn"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live candy ccache config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GCOV="llvm-cov"
GENTOO_MIRRORS="http://distfiles.gentoo.org /etc/portage/package.mirrors"
LANG="en_US.utf8"
LD="ld.lld"
LDFLAGS=" -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--threads=8"
LEX="flex"
LINGUAS="*"
MAKEOPTS="-j8 -l8"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/etc/portage/package.distfiles/bin"
PORTAGE_BINHOST="https://calculate.mirror.garr.it/grp/x86_64"
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="/etc/portage/package.tmp"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
RUSTFLAGS=""
SHELL="/bin/bash"
SIZE="llvm-size"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="acl aes amd64 avx avx2 bzip2 cli crypt dri f16c fma3 fortran gdbm iconv ipv6 libtirpc mmx mmxext multilib ncurses nls nptl openmp pam pclmul pcre popcnt rdrand readline seccomp sha split-usr sse sse2 sse3 sse4_1 sse4_2 sse4a ssl ssse3 test-rust unicode xattr zlib" ABI_X86="32 64" ADA_TARGET="gnat_2021" CALLIGRA_FEATURES="karbon sheets words" 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" INPUT_DEVICES="libinput wacom" KERNEL="linux" L10N="*" LLVM_TARGETS="BPF NVPTX X86" LUA_SINGLE_TARGET="lua5-4" LUA_TARGETS="lua5-1" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="nvidia"
Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

sys-libs/libblockdev-3.0.1::unhappy-ending was built with the following:
USE="-cryptsetup device-mapper -escrow -gtk-doc introspection -lvm nvme -test tools" ABI_X86="(64)" PYTHON_SINGLE_TARGET="-python3_10 python3_11"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live candy 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 split-log strict unknown-features-warn unmerge-orphans userfetch userpriv usersandbox usersync xattr"
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-17 07:44:05 UTC
The issue was really:

ld.lld: [0;31merror: [0mundefined reference due to --no-allow-shlib-undefined: uuid_generate
>>> referenced by /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/libparted-fs-resize.so
clang-16: [0;1;31merror: [0m[1mlinker command failed with exit code 1 (use -v to see invocation)[0m
make[1]: *** [Makefile:490: vfat-resize] Error 1

-> we need https://git.savannah.gnu.org/cgit/parted.git/commit/?id=d22c2d01f62139e0d386d90584cac0705857a571.
Comment 14 Larry the Git Cow gentoo-dev 2023-10-17 07:56:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c5d7fefe2750ec21f43663b5808bfad9832e53c

commit 7c5d7fefe2750ec21f43663b5808bfad9832e53c
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-17 07:51:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-17 07:53:34 +0000

    sys-block/parted: fix underlinking with libuuid (util-linux)
    
    This showed up when building libblockdev.
    
    Closes: https://bugs.gentoo.org/910487
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/parted-3.6-underlinked-util-linux.patch  | 26 +++++++
 sys-block/parted/parted-3.6-r1.ebuild              | 82 ++++++++++++++++++++++
 2 files changed, 108 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=347e755c354967331027544978bec210e5624f21

commit 347e755c354967331027544978bec210e5624f21
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-17 07:53:08 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-17 07:53:35 +0000

    sys-libs/libblockdev: add 3.0.4
    
    This also drops the LLD workaround as the issue was in parted (now fixed).
    
    Bug: https://bugs.gentoo.org/910487
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/libblockdev/Manifest                 |   1 +
 sys-libs/libblockdev/libblockdev-3.0.4.ebuild | 126 ++++++++++++++++++++++++++
 2 files changed, 127 insertions(+)
Comment 15 David Carlos Manuelda 2023-10-19 07:03:26 UTC
Hi Sam, can you please reopen? I am having this exact problem also on =sys-libs/libblockdev-3.0.4 (but not in parted) I don't think it is needed a separate bugreport if the error is the same but let me know if otherwise.
Comment 16 Christopher Fore 2023-12-18 00:04:52 UTC
Created attachment 879764 [details]
musl build.log

Seems to be happening on musl now as well on sys-block/parted-3.6-r1.
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-18 00:37:51 UTC
Sorry David I missed your comment!
Comment 18 Agostino Sarubbo gentoo-dev 2024-02-21 13:02:56 UTC
*** Bug 925172 has been marked as a duplicate of this bug. ***
Comment 19 David Carlos Manuelda 2024-04-11 17:46:39 UTC
(In reply to Larry the Git Cow from comment #7)
> The bug has been closed via the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=199a157b43188adb4e2da3f0d285a7a6a351ea44
> 
> commit 199a157b43188adb4e2da3f0d285a7a6a351ea44
> Author:     Marek Szuba <marecki@gentoo.org>
> AuthorDate: 2023-08-19 11:40:46 +0000
> Commit:     Marek Szuba <marecki@gentoo.org>
> CommitDate: 2023-08-19 16:24:07 +0000
> 
>     sys-libs/libblockdev: work around problems with sys-devel/lld
>     
>     Closes: https://bugs.gentoo.org/910487
>     Signed-off-by: Marek Szuba <marecki@gentoo.org>
> 
>  sys-libs/libblockdev/libblockdev-3.0.2-r1.ebuild | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

I reproduced the same issue with 3.1.1 and manually applying this patch makes it compile again.

Can you reintroduce it while a proper fix is done?
Comment 20 David Carlos Manuelda 2024-04-11 17:48:09 UTC
But I guess this can be a problem on musl systems with no gcc at all
Comment 21 vadorovsky 2024-04-21 12:56:00 UTC
Yes, I confirm the issue. It happens to me both with 3.1.1 and 3.0.4 on musl-llvm profile:

ld.lld: error: undefined reference due to --no-allow-shlib-undefined: uuid_generate
>>> referenced by /usr/lib/libparted-fs-resize.so
Comment 22 vadorovsky 2024-04-23 19:53:43 UTC
I managed to fix it without falling back to BFD.

https://github.com/storaged-project/libblockdev/pull/1021
https://github.com/gentoo/gentoo/pull/36384


The error was legit with LLD's strict approach - the `-luuid` ldflag was missing in tools/ directory.
Comment 23 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-23 23:01:51 UTC
If the symbol is referenced from libparted-fs-resize.so, then isn't it really missing from parted?
Comment 24 vadorovsky 2024-04-24 06:24:00 UTC
It's undefined in libparted-fs-resize.so

❯ nm -D /usr/lib/libparted-fs-resize.so
                 w __cxa_finalize
                 w __deregister_frame_info
                 w __register_frame_info
                 U __stack_chk_fail
                 U exit
                 U fat16_type
                 U fat32_type
                 U memcpy
                 U memset
                 U ped_alignment_any
                 U ped_alignment_init
                 U ped_assert
                 U ped_constraint_new
                 U ped_device_close
                 U ped_device_open
                 U ped_exception_catch
                 U ped_exception_fetch_all
                 U ped_exception_leave_all
                 U ped_exception_throw
0000000000008100 T ped_file_system_close@@LIBPARTED_FS_RESIZE_0.0.0
00000000000083e0 T ped_file_system_get_resize_constraint@@LIBPARTED_FS_RESIZE_0.0.0
0000000000007f80 T ped_file_system_open@@LIBPARTED_FS_RESIZE_0.0.0
                 U ped_file_system_probe
                 U ped_file_system_probe_specific
00000000000081d0 T ped_file_system_resize@@LIBPARTED_FS_RESIZE_0.0.0
                 U ped_geometry_destroy
                 U ped_geometry_duplicate
                 U ped_geometry_init
                 U ped_geometry_map
                 U ped_geometry_new
                 U ped_geometry_read
                 U ped_geometry_read_alloc
                 U ped_geometry_set
                 U ped_geometry_set_end
                 U ped_geometry_sync
                 U ped_geometry_sync_fast
                 U ped_geometry_test_equal
                 U ped_geometry_test_inside
                 U ped_geometry_test_overlap
                 U ped_geometry_test_sector_inside
                 U ped_geometry_write
                 U ped_malloc
                 U ped_timer_destroy_nested
                 U ped_timer_new_nested
                 U ped_timer_reset
                 U ped_timer_set_state_name
                 U ped_timer_update
                 U ped_unit_format
                 U ptt_geom_clear_sectors
                 U rpl_free
                 U strcmp
                 U strcpy
                 U strdup
                 U strlen
                 U strncmp
                 U uuid_generate

It's defined with a version in libuuid

❯ nm -D /usr/lib/libuuid.so
                 w __cxa_finalize
                 w __deregister_frame_info
                 U __errno_location
                 w __register_frame_info
                 U __stack_chk_fail
                 U __tls_get_addr
00000000000033d0 T __uuid_generate_random@@UUIDD_PRIVATE
0000000000002e60 T __uuid_generate_time@@UUIDD_PRIVATE
0000000000003130 T __uuid_generate_time_cont@@UUIDD_PRIVATE
                 U close
                 U connect
                 U fclose
                 U fdopen
                 U fflush
                 U flock
                 U fprintf
                 U fscanf
                 U getpid
                 U getppid
                 U getrandom
                 U gettimeofday
                 U getuid
                 U ioctl
                 U isxdigit
                 U jrand48
                 U memcpy
                 U memset
                 U nanosleep
                 U open
                 U random
                 U read
                 U rewind
                 U socket
                 U srandom
                 U strcmp
                 U strlen
                 U strncpy
                 U strtoul
                 U syscall
                 U time
                 U umask
0000000000002d30 T uuid_clear@@UUID_1.0
0000000000002d40 T uuid_compare@@UUID_1.0
0000000000002df0 T uuid_copy@@UUID_1.0
0000000000003520 T uuid_generate@@UUID_1.0
00000000000035b0 T uuid_generate_md5@@UUID_2.31
00000000000034a0 T uuid_generate_random@@UUID_1.0
0000000000003690 T uuid_generate_sha1@@UUID_2.31
0000000000003140 T uuid_generate_time@@UUID_1.0
00000000000033c0 T uuid_generate_time_safe@@UUID_2.20
0000000000004800 T uuid_get_template@@UUID_2.31
0000000000003dd0 T uuid_is_null@@UUID_1.0
0000000000003e60 T uuid_parse@@UUID_1.0
0000000000003ea0 T uuid_parse_range@@UUID_2.36
00000000000046b0 T uuid_time@@UUID_1.0
0000000000004760 T uuid_type@@UUID_1.0
00000000000044f0 T uuid_unparse@@UUID_1.0
0000000000004170 T uuid_unparse_lower@@UUID_1.0
0000000000004330 T uuid_unparse_upper@@UUID_1.0
00000000000047a0 T uuid_variant@@UUID_1.0
                 U write

So the LLD error (due to enforcement of no-allow-shlib-undefined by default) and my fix still make sense to me. Is there something I'm missing?