Summary: | sys-libs/libucontext: Build does not contain weak / unprefixed symbols | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Andrew Athalye <andrewathalye> |
Component: | Current packages | Assignee: | Gentoo musl team <musl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andrewathalye, herrtimson, sam |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=832676 https://github.com/kaniini/libucontext/issues/39 https://bugs.gentoo.org/show_bug.cgi?id=832700 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
A rudimentary patch to include -DUNPREFIXED_SYMBOLS manually, since CFLAGS is overridden by the ebuild.
Makefile patch: set CFLAGS only if unset EBUILD: Specify CFLAGS before emake to prevent the Makefile's logic from being overridden |
Description
Andrew Athalye
2022-02-04 04:58:39 UTC
Created attachment 764312 [details, diff]
A rudimentary patch to include -DUNPREFIXED_SYMBOLS manually, since CFLAGS is overridden by the ebuild.
Signed-off-by: Andrew Athalye
Created attachment 764319 [details, diff]
Makefile patch: set CFLAGS only if unset
Created attachment 764322 [details]
EBUILD: Specify CFLAGS before emake to prevent the Makefile's logic from being overridden
The primary changes made were to invoke make as CFLAGS="${CFLAGS}" emake and to include the set-cflags-if-unset patch.
I've made an edited EBUILD and small Makefile patch to hopefully resolve the issue. In my testing it worked as expected and all necessary CFLAGS were passed to the compiler, leading to weak symbols being included. I've opened an issue upstream as well and submitted both this patch and one which simply concatenates the CFLAGS together. Thanks for your work here. Please do link to upstream bugs here and vice versa though. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d8718303b00e24d21ce70a6891a096e89c96f1d commit 1d8718303b00e24d21ce70a6891a096e89c96f1d Author: Sam James <sam@gentoo.org> AuthorDate: 2022-02-07 03:56:24 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-02-07 04:00:57 +0000 sys-libs/libucontext: respect CFLAGS without overriding upstream define Fixes musl runtime as the right symbols get defined now (unprefixed). Bug: https://github.com/rui314/mold/issues/281 Bug: https://bugs.gentoo.org/832700 Closes: https://bugs.gentoo.org/832677 Thanks-to: Andrew Athalye <andrewathalye@outlook.com> Signed-off-by: Sam James <sam@gentoo.org> .../libucontext/files/libucontext-1.1-respect-CFLAGS.patch | 13 +++++++++++++ .../{libucontext-1.1.ebuild => libucontext-1.1-r1.ebuild} | 10 +++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) hey, I don't have a current usecase for libucontext, but with the patch there are still unresolved symbols in libucontext_posix.so.1: ldd /usr/lib/libucontext_posix.so.1 ldd (0x7fbbc5b000) libc.so => ldd (0x7fbbc5b000) Error relocating /usr/lib/libucontext_posix.so.1: libucontext_getcontext: symbol not found Error relocating /usr/lib/libucontext_posix.so.1: libucontext_swapcontext: symbol not found Error relocating /usr/lib/libucontext_posix.so.1: libucontext_setcontext: symbol not found for your information only (In reply to tt_1 from comment #7) > hey, I don't have a current usecase for libucontext, but with the patch > there are still unresolved symbols in libucontext_posix.so.1: > > ldd /usr/lib/libucontext_posix.so.1 > ldd (0x7fbbc5b000) > libc.so => ldd (0x7fbbc5b000) > Error relocating /usr/lib/libucontext_posix.so.1: libucontext_getcontext: > symbol not found > Error relocating /usr/lib/libucontext_posix.so.1: libucontext_swapcontext: > symbol not found > Error relocating /usr/lib/libucontext_posix.so.1: libucontext_setcontext: > symbol not found > > > for your information only In an Alpine container: ``` / # ldd /lib/libucontext_posix.so.1 /lib/ld-musl-x86_64.so.1 (0x7f63920f2000) libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f63920f2000) Error relocating /lib/libucontext_posix.so.1: libucontext_getcontext: symbol not found Error relocating /lib/libucontext_posix.so.1: libucontext_swapcontext: symbol not found Error relocating /lib/libucontext_posix.so.1: libucontext_setcontext: symbol not found ``` but libucontext.so is fine for me, so I think this is intended (to do with how the real POSIX symbols are just setcontext, etc, not prefixed). |