Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 838172 - sys-libs/musl installs /usr/include/ucontext.h, but does not implement the functions declared within it (was: sys-libs/libxcrypt-4.4.28-r2 fails tests on MUSL: ld: explicit-bzero.c:(.text.startup+0xed): undefined reference to makecontext)
Summary: sys-libs/musl installs /usr/include/ucontext.h, but does not implement the fu...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-13 07:14 UTC by Agostino Sarubbo
Modified: 2022-11-02 03:02 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,283.99 KB, text/plain)
2022-04-13 07:14 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-04-13 07:14:07 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sys-libs/libxcrypt-4.4.28 fails tests on MUSL.
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-04-13 07:14:10 UTC
Created attachment 770495 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-04-13 07:14:11 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


/usr/lib/gcc/x86_64-gentoo-linux-musl/11.2.1/../../../../x86_64-gentoo-linux-musl/bin/ld: explicit-bzero.c:(.text.startup+0x108): undefined reference to `swapcontext'
/usr/lib/gcc/x86_64-gentoo-linux-musl/11.2.1/../../../../x86_64-gentoo-linux-musl/bin/ld: explicit-bzero.c:(.text.startup+0x134): undefined reference to `swapcontext'
/usr/lib/gcc/x86_64-gentoo-linux-musl/11.2.1/../../../../x86_64-gentoo-linux-musl/bin/ld: explicit-bzero.c:(.text.startup+0x177): undefined reference to `swapcontext'
/usr/lib/gcc/x86_64-gentoo-linux-musl/11.2.1/../../../../x86_64-gentoo-linux-musl/bin/ld: explicit-bzero.c:(.text.startup+0xed): undefined reference to `makecontext'
explicit-bzero.c:(.text+0x3c5): undefined reference to `swapcontext'
explicit-bzero.c:(.text+0x5a): undefined reference to `swapcontext'
explicit-bzero.c:(.text+0xd5): undefined reference to `swapcontext'
explicit-bzero.c:(.text.startup+0x92): undefined reference to `getcontext'
collect2: error: ld returned 1 exit status
Comment 3 Fabian Groffen gentoo-dev 2022-06-01 19:47:12 UTC
https://wiki.musl-libc.org/open-issues.html#ucontext.h

these functions (swapcontext, makecontext) are not implemented, and need to be blocked out when using musl

we could drop test/explicit-bzero from check_PROGRAMS (Makefile.am) for musl
Comment 4 Agostino Sarubbo gentoo-dev 2022-10-08 10:20:37 UTC
tinderbox_musl has reproduced this issue with version 4.4.28-r2 - Updating summary.
Comment 5 Mike Gilbert gentoo-dev 2022-10-08 14:53:47 UTC
(In reply to Fabian Groffen from comment #3)

musl installs /usr/include/ucontext.h which declares the swapcontext and getcontext functions. If libc doesn't provide these functions, arguably /usr/include/ucontext.h should not be installed at all.

libxcrypt has a configure test that checks for ucontext.h, and there is a check in test/explicit-bzero.c that checks for HAVE_UCONTEXT_H. If the macro is not set, the test simply exits with status 77 (skip).
Comment 6 Larry the Git Cow gentoo-dev 2022-10-08 15:31:37 UTC
The bug has been closed via the following commit(s):

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

commit 6da5a9571d82af96730a4ecb966b58b4c18c13a7
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-10-08 15:29:25 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-10-08 15:29:25 +0000

    sys-libs/libxcrypt: add musl workaround
    
    Closes: https://bugs.gentoo.org/838172
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-libs/libxcrypt/libxcrypt-4.4.28-r1.ebuild | 7 +++++++
 sys-libs/libxcrypt/libxcrypt-4.4.28-r2.ebuild | 7 +++++++
 2 files changed, 14 insertions(+)
Comment 7 Larry the Git Cow gentoo-dev 2022-11-02 03:02:33 UTC
The bug has been closed via the following commit(s):

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

commit 67b62e98c3b475c46489f25469492f579ed531ca
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-02 02:29:52 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-02 02:29:52 +0000

    sys-libs/libxcrypt: add 4.4.30
    
    Closes: https://bugs.gentoo.org/838172
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/libxcrypt/Manifest                |   1 +
 sys-libs/libxcrypt/libxcrypt-4.4.30.ebuild | 329 +++++++++++++++++++++++++++++
 2 files changed, 330 insertions(+)