Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 931782

Summary: sys-libs/musl: broken crti.o for arm64
Product: Gentoo Linux Reporter: mojyack <mojyack>
Component: Current packagesAssignee: Anthony Basile <blueness>
Status: RESOLVED FIXED    
Severity: normal CC: bugdal, lu_zero, mojyack, musl, toolchain
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: ARM64   
OS: Linux   
See Also: http://github.com/rui314/mold/issues/1255
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 830404    
Attachments: musl-crti-alignment.patch

Description mojyack 2024-05-12 05:45:36 UTC
See github.com/rui314/mold/issues/1255 (Sorry, the link is hidden because I created a new account.)
musl's crti.o has not aligned .init and .fini section, which produces broken binaries if linked by particular linker(like mold).
I suggest adding the patch in the link to musl.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-12 05:48:15 UTC
Created attachment 892752 [details, diff]
musl-crti-alignment.patch
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-12 05:48:43 UTC
dalias, would you mind taking a look please?
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-18 04:56:27 UTC
Thank you for the patch. dalias has kindly committed it upstream. I'll pull it in probably later today.
Comment 4 mojyack 2024-05-18 06:12:49 UTC
Nice!
Comment 5 Larry the Git Cow gentoo-dev 2024-05-20 08:16:55 UTC
The bug has been closed via the following commit(s):

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

commit 9aabd6aa9abd2c48f85cb582fadf81eae944600f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-20 08:16:22 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-20 08:16:42 +0000

    sys-libs/musl: fix crti.o on arm64
    
    Closes: https://bugs.gentoo.org/931782
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/musl-1.2.4-arm64-crti-alignment.patch    |  32 ++++
 sys-libs/musl/musl-1.2.4-r2.ebuild                 | 205 ++++++++++++++++++++
 sys-libs/musl/musl-1.2.5-r1.ebuild                 | 207 +++++++++++++++++++++
 3 files changed, 444 insertions(+)