Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948878 - dev-libs/elfutils-0.191-r2 fails to build with sys-libs/error-standalone installed (MUSL): ld.lld: error: undefined symbol: error
Summary: dev-libs/elfutils-0.191-r2 fails to build with sys-libs/error-standalone inst...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2025-01-27 03:00 UTC by Zhixu Liu
Modified: 2025-01-29 22:47 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhixu Liu 2025-01-27 03:00:13 UTC
using profile: default/linux/amd64/23.0/musl/llvm

build will failed if sys-libs/error-standalone is installed.

clang -std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes    -Wnull-dereference -Wimplicit-fallthrough   -Wunused -Wextra     -D_FORTIFY_SOURCE=3 -O2 -pipe -g -fno-addrsig  -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--build-id -o libdw.so -shared -Wl,-z,defs -Wl,-z,relro -o libdw.so \
        -Wl,--soname,libdw.so.1,--enable-new-dtags \
        -Wl,--version-script,/var/tmp/portage/dev-libs/elfutils-0.191-r2/work/elfutils-0.191/libdw/libdw.map \
        -Wl,--no-undefined \
        -Wl,--whole-archive ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a ../libdwfl/libdwfl_pic.a -Wl,--no-whole-archive \
        ../lib/libeu.a ../libelf/libelf.so -ldl -lz -largp -lfts -lobstack -lzstd -lbz2  -pthread
ld.lld: error: undefined symbol: error
>>> referenced by libdw_alloc.c:155 (/var/tmp/portage/dev-libs/elfutils-0.191-r2/work/elfutils-0.191/libdw/libdw_alloc.c:155)
>>>               libdw_alloc.os:(__libdw_oom) in archive libdw_pic.a

the reason has been described in https://bugs.gentoo.org/864787, and build.log is there too.

Reproducible: Always
Comment 1 Alfred Wingate 2025-01-27 05:24:30 UTC
Sent a patch upstream https://sourceware.org/pipermail/elfutils-devel/2025q1/007770.html
Comment 3 Larry the Git Cow gentoo-dev 2025-01-29 22:47:56 UTC
The bug has been closed via the following commit(s):

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

commit a4aa03f192a3b51ffce6e540220c3b466d3381ae
Author:     Z. Liu <zhixu.liu@gmail.com>
AuthorDate: 2025-01-26 17:57:39 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-01-29 22:47:26 +0000

    dev-libs/elfutils: fix build failed w/ musl
    
    error() is available in glibc, not in musl, configure check header
    file "error.h" only. If sys-libs/error-standalone is installed, check
    report ok, but link will fail because no "-lerror". So update configure.ac
    to check both error.h exist and can be linked without any extra "-l...",
    if not then fallback to err.h which cause built-in error() to be used.
    
    Closes: https://bugs.gentoo.org/948878
    Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/40322
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-libs/elfutils/elfutils-0.191-r2.ebuild         |  3 +-
 dev-libs/elfutils/elfutils-0.192-r1.ebuild         |  3 +-
 ...0.191-musl-configure-better-error-h-check.patch | 32 ++++++++++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)