summaryrefslogtreecommitdiff
path: root/sys-libs/musl
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-05-21 00:05:36 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-05-21 00:05:36 +0100
commitbfd63d5b0e96ad32e0d0a8fe15512b6a9ac6fc9e (patch)
tree4d1f8172a8137960573865b4a5ac8b7846d281df /sys-libs/musl
parent77b275a53383b07b154caa09feb6f4961b206638 (diff)
gentoo auto-resync : 21:05:2024 - 00:05:35
Diffstat (limited to 'sys-libs/musl')
-rw-r--r--sys-libs/musl/Manifest3
-rw-r--r--sys-libs/musl/files/musl-1.2.4-arm64-crti-alignment.patch32
-rw-r--r--sys-libs/musl/musl-1.2.4-r2.ebuild205
-rw-r--r--sys-libs/musl/musl-1.2.5-r1.ebuild207
4 files changed, 447 insertions, 0 deletions
diff --git a/sys-libs/musl/Manifest b/sys-libs/musl/Manifest
index abc1c105f11e..d783eddf3d22 100644
--- a/sys-libs/musl/Manifest
+++ b/sys-libs/musl/Manifest
@@ -1,4 +1,5 @@
AUX ldconfig.in-r3 3093 BLAKE2B 146374fe711c660a61e4a23f89ae066e78b8bca6884719c058981069ab92833d7f660b7bd78e7c8b86112944706823f0260d7c63f19d64960f27f44b4e95a6a3 SHA512 ba021cf7d52c001d6ef9a54a91de93240cd7eef9f7a6d7a48ae0c58f934aaea6796979ce80e1cfa9bdc6008023108f3c226440360f8e3134fc23f7fdac0e55b1
+AUX musl-1.2.4-arm64-crti-alignment.patch 847 BLAKE2B 4f652b924fd9b7a396d21cf8fef0d618c23ce14ea662290850e9a8ed78ac6303f674ac978f74e86f8671df75a7749ee54bbbe11278ae283892d1157e540a86d8 SHA512 77d6a4798a71d3593621bb8d3177b288f04bc0e5a4b2a6b91e8ad73e8a96279a4ae18344df77fafb97228931d6e6306b4b0c2adba8dded6449b7bb2565041d31
AUX musl-1.2.4-elfutils-0.190-relr.patch 2930 BLAKE2B 81bcc8932eb4ffb7cf0ae5707866d755c731e67bdcfa71e097f48ee3f13ab75fc96645bfc76e376cda700d81fbb6f7e47f83b06964ded9ea173c262965e4cb04 SHA512 47a24912f5dc16e21a0692c8f0b323dec815867dca7d65f97740a0ad2623c42cd0711e0b69609f24774db8cb26518e2ee5577b4a89d36cc2b053ba7b879cb2f8
AUX stack_chk_fail_local.c 1798 BLAKE2B 380bcbb920bd40a5185246621ba93716f27d61cd0077cd796ff267e10c534c9cc64982b2a66c89b61395dc93d67dae77e8c59908f65f2903f16016180cf94bbb SHA512 bb0bdd7f205d57771920c7ea898c1f84a55d6f90ddd1f8203bfeed98d13ccefa6f68d5fd1c0761321b2732ca928ca81b425e3fe8321c936d1316dea6f1930091
DIST getconf.c 11614 BLAKE2B ba49a573fc16d51780a0b0b81fbf7b64a1142f1dbad203c9609a59b6b07e7404f676c415383ae88c0aede95694821f6ee381bffd93cc3330501e17dc07d122bd SHA512 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d
@@ -12,6 +13,8 @@ DIST musl-1.2.5.tar.gz.asc 490 BLAKE2B f0d91b20aa7729449bd02a60adf17e8287904ed59
DIST musl-getent-93a08815f8598db442d8b766b463d0150ed8e2ab.c 11656 BLAKE2B 1b7bf7102a1eb91a8cb881ed8ca65eb8eed911dd50238e97dc2952d89d4c6ebed6bfd046a2b38776c550b2872ab54ced8cb452fcc2ad56e5616f722debda761f SHA512 7f5b9d934d82deb5f8b23e16169a5d9b99ccab3a4708df06a95d685e1b24a3a3e69b3dcf4942f2f66c12a3d4bf0c5827e2ee2e8c4d7b1997359fccc2ac212dee
EBUILD musl-1.2.3-r8.ebuild 5934 BLAKE2B 6b59d02f8163923c41f66535cd3e1fd5a476a6a7426677f65fac1be3759d2453fcd42e7e0fea522fbe90684346974910bea737c8624921f9924ad348fc7d06e4 SHA512 73894ff4988ce54113bb1d46ca53ae1be12fdf0f56209406e7931c645f250e6a8f10417d3f31906d10526dabb841535af603073e6fae7b25fe5a157d1639f94e
EBUILD musl-1.2.4-r1.ebuild 5723 BLAKE2B 2c40e6a549a79610d4c1c73d159eaa238fdbe2a965ebd781e617b7829010624c1ad38e9b2335bf77b0bf5ea2887128d3475aae4fb98cebfb9d36596bbad9e86b SHA512 25c4b6d7d09a90662aa8a2e7fd7cbab13b6439ba3a65c7f52c39e30bf4eacc224d2c3d9d81ff1088d0e32406c6513189281d6ab27788cb3a3c583cce3725f161
+EBUILD musl-1.2.4-r2.ebuild 5785 BLAKE2B 913bb167f55ba2c35ae0d1db85a67c1ef5430826a1402c3cdb91f75ff520e9f3c4e1c467d29b68a131da19644ad4cda3e4f79c840370eba6efff542b6673ac9a SHA512 6e10ce461c28516f19df9410ee3b5cf0762672c2a5c1453566df10d080829230509880b433b874aab4e268fae6a373265cb0780287607a30d1b6bc9e3c8a9e71
+EBUILD musl-1.2.5-r1.ebuild 5783 BLAKE2B 4ba1b947af8452818c3b3b5c8fdc0e63c4f2e657fd5cdd7623fb66976bc45cbf9a059d8346aa69f9e4d1038798537cd7d6a6225f1a2317c67dd679c109e20759 SHA512 f4df9f85a50ac27e7cc62aeeb348a6e3179f340f7953bcafbe9fcc953aef075ade4d518ddbce2b0fe6163dab5a6361d01e8c6aed15891fd6188cb14a6cda2abb
EBUILD musl-1.2.5.ebuild 5714 BLAKE2B 5d539f26f6bcfe43bdcfd23a3d84659a2cadf3ecc9c01a812303a0d699343689ac0d310ffea98199a21da40be61e9c8082a01162d9af57b2d8254bba5c983d77 SHA512 76c8ee66312bc1b9bc7c0d68531b92affe352301b9676e04ec776c9a91acfda43c4f6c324830e056d9753a6e11137fd57559adfbcc99ceb384dd3940b62c8841
EBUILD musl-9999.ebuild 5691 BLAKE2B 47179b9846400c4a6eefab996bfb928a10f96de3324094072c5fdc5f529e1a964f2fd2668e2386274d9f4f7d902ab234d8fc9233b903208700a9f88f044b1a41 SHA512 d4a89572ea8d6605ebb6e0b6c81cc9934da8d3be31ae4a57007d4e5bd47cfec9d1dc69a4d0411f9b076df7bf6e9248ff2da53e76ba63d9b73431663f58279d67
MISC metadata.xml 559 BLAKE2B 8b1093a5278f716b8e21467b325e373a790f54c8ab71b92adc4c87dd569a92b20e08009372065f0f27ced39e3361c9e5e5a2e1bff271753d280439fabbddd3a4 SHA512 a35c13ea32ac8f26984bdb0d70d28a4285f34e32a2b0b17ad98fe3f357fb46c87a1e853377630d4da58fd5953de3fdeb02ee89181394e1815f5e0bbba4cd9f92
diff --git a/sys-libs/musl/files/musl-1.2.4-arm64-crti-alignment.patch b/sys-libs/musl/files/musl-1.2.4-arm64-crti-alignment.patch
new file mode 100644
index 000000000000..8b548bdb255f
--- /dev/null
+++ b/sys-libs/musl/files/musl-1.2.4-arm64-crti-alignment.patch
@@ -0,0 +1,32 @@
+https://git.musl-libc.org/cgit/musl/commit/?id=cbf59dd662cea8786c2f3a5ea21f8da64f002b30
+https://github.com/rui314/mold/issues/1255
+https://bugs.gentoo.org/931782
+
+From cbf59dd662cea8786c2f3a5ea21f8da64f002b30 Mon Sep 17 00:00:00 2001
+From: mojyack <mojyack@gmail.com>
+Date: Sun, 12 May 2024 12:13:06 -0400
+Subject: aarch64 crti.o: fix alignment of _init/_fini
+
+without explicit alignment directives, whether they end up at the
+necessary alignment depends on linker/linking conditions. initially
+reported as mold issue 1255.
+--- a/crt/aarch64/crti.s
++++ b/crt/aarch64/crti.s
+@@ -1,6 +1,7 @@
+ .section .init
+ .global _init
+ .type _init,%function
++.align 2
+ _init:
+ stp x29,x30,[sp,-16]!
+ mov x29,sp
+@@ -8,6 +9,7 @@ _init:
+ .section .fini
+ .global _fini
+ .type _fini,%function
++.align 2
+ _fini:
+ stp x29,x30,[sp,-16]!
+ mov x29,sp
+--
+cgit v1.2.1
diff --git a/sys-libs/musl/musl-1.2.4-r2.ebuild b/sys-libs/musl/musl-1.2.4-r2.ebuild
new file mode 100644
index 000000000000..1ec30208d947
--- /dev/null
+++ b/sys-libs/musl/musl-1.2.4-r2.ebuild
@@ -0,0 +1,205 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev flag-o-matic toolchain-funcs prefix
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://git.musl-libc.org/git/musl"
+ inherit git-r3
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/musl.asc
+ inherit verify-sig
+
+ SRC_URI="https://musl.libc.org/releases/${P}.tar.gz"
+ SRC_URI+=" verify-sig? ( https://musl.libc.org/releases/${P}.tar.gz.asc )"
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~x86"
+
+ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-musl )"
+fi
+GETENT_COMMIT="93a08815f8598db442d8b766b463d0150ed8e2ab"
+GETENT_FILE="musl-getent-${GETENT_COMMIT}.c"
+SRC_URI+="
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://gitlab.alpinelinux.org/alpine/aports/-/raw/${GETENT_COMMIT}/main/musl/getent.c -> ${GETENT_FILE}
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c
+"
+
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
+HOMEPAGE="https://musl.libc.org"
+
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="crypt headers-only split-usr"
+
+QA_SONAME="usr/lib/libc.so"
+QA_DT_NEEDED="usr/lib/libc.so"
+# bug #830213
+QA_PRESTRIPPED="usr/lib/crtn.o"
+
+# We want crypt on by default for this as sys-libs/libxcrypt isn't (yet?)
+# built as part as crossdev. Also, elide the blockers when in cross-*,
+# as it doesn't make sense to block the normal CBUILD libxcrypt at all
+# there when we're installing into /usr/${CHOST} anyway.
+if is_crosspkg ; then
+ IUSE="${IUSE/crypt/+crypt}"
+else
+ RDEPEND="crypt? ( !sys-libs/libxcrypt[system] )"
+ PDEPEND="!crypt? ( sys-libs/libxcrypt[system] )"
+fi
+
+PATCHES=(
+ "${FILESDIR}"/${P}-elfutils-0.190-relr.patch
+ "${FILESDIR}"/${PN}-1.2.4-arm64-crti-alignment.patch
+)
+
+just_headers() {
+ use headers-only && target_is_not_host
+}
+
+pkg_setup() {
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-musl*) ;;
+ *) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+ esac
+ fi
+
+ # fix for #667126, copied from glibc ebuild
+ # make sure host make.conf doesn't pollute us
+ if target_is_not_host || tc-is-cross-compiler ; then
+ CHOST=${CTARGET} strip-unsupported-flags
+ fi
+}
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ elif use verify-sig ; then
+ # We only verify the release; not the additional (fixed, safe) files
+ # we download.
+ # (Seem to get IPC error on verifying in cross?)
+ ! target_is_not_host && verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}
+ fi
+
+ default
+}
+
+src_prepare() {
+ default
+
+ mkdir "${WORKDIR}"/misc || die
+ cp "${DISTDIR}"/getconf.c "${WORKDIR}"/misc/getconf.c || die
+ cp "${DISTDIR}/${GETENT_FILE}" "${WORKDIR}"/misc/getent.c || die
+ cp "${DISTDIR}"/iconv.c "${WORKDIR}"/misc/iconv.c || die
+}
+
+src_configure() {
+ strip-flags && filter-lto # Prevent issues caused by aggressive optimizations & bug #877343
+ tc-getCC ${CTARGET}
+
+ just_headers && export CC=true
+
+ local sysroot
+ target_is_not_host && sysroot=/usr/${CTARGET}
+ ./configure \
+ --target=${CTARGET} \
+ --prefix="${EPREFIX}${sysroot}/usr" \
+ --syslibdir="${EPREFIX}${sysroot}/lib" \
+ --disable-gcc-wrapper || die
+}
+
+src_compile() {
+ emake obj/include/bits/alltypes.h
+ just_headers && return 0
+
+ emake
+ if ! is_crosspkg ; then
+ emake -C "${T}" getconf getent iconv \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ VPATH="${WORKDIR}/misc"
+ fi
+
+ $(tc-getCC) ${CFLAGS} -c -o libssp_nonshared.o "${FILESDIR}"/stack_chk_fail_local.c || die
+ $(tc-getAR) -rcs libssp_nonshared.a libssp_nonshared.o || die
+}
+
+src_install() {
+ local target="install"
+ just_headers && target="install-headers"
+ emake DESTDIR="${D}" ${target}
+ just_headers && return 0
+
+ # musl provides ldd via a sym link to its ld.so
+ local sysroot=
+ target_is_not_host && sysroot=/usr/${CTARGET}
+ local ldso=$(basename "${ED}${sysroot}"/lib/ld-musl-*)
+ dosym -r "${sysroot}/lib/${ldso}" "${sysroot}/usr/bin/ldd"
+
+ if ! use crypt ; then
+ # Allow sys-libs/libxcrypt[system] to provide it instead
+ rm "${ED}/usr/include/crypt.h" || die
+ rm "${ED}/usr/$(get_libdir)/libcrypt.a" || die
+ fi
+
+ if ! is_crosspkg ; then
+ # Fish out of config:
+ # ARCH = ...
+ # SUBARCH = ...
+ # and print $(ARCH)$(SUBARCH).
+ local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
+
+ # The musl build system seems to create a symlink:
+ # ${D}/lib/ld-musl-${arch}.so.1 -> /usr/lib/libc.so.1 (absolute)
+ # During cross or within prefix, there's no guarantee that the host is
+ # using musl so that file may not exist. Use a relative symlink within
+ # ${D} instead.
+ rm "${ED}"/lib/ld-musl-${arch}.so.1 || die
+ if use split-usr; then
+ dosym ../usr/lib/libc.so /lib/ld-musl-${arch}.so.1
+ # If it's still a dead symlink, OK, we really do need to abort.
+ [[ -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] || die
+ else
+ dosym libc.so /usr/lib/ld-musl-${arch}.so.1
+ [[ -e "${ED}"/usr/lib/ld-musl-${arch}.so.1 ]] || die
+ fi
+
+ cp "${FILESDIR}"/ldconfig.in-r3 "${T}"/ldconfig.in || die
+ sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
+ eprefixify "${T}"/ldconfig
+ into /
+ dosbin "${T}"/ldconfig
+ into /usr
+ dobin "${T}"/getconf
+ dobin "${T}"/getent
+ dobin "${T}"/iconv
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
+ doenvd "${T}"/00musl
+ fi
+
+ if target_is_not_host ; then
+ into /usr/${CTARGET}
+ dolib.a libssp_nonshared.a
+ else
+ dolib.a libssp_nonshared.a
+ fi
+}
+
+pkg_preinst() {
+ # nothing to do if just installing headers
+ just_headers && return
+
+ # prepare /etc/ld.so.conf.d/ for files
+ mkdir -p "${EROOT}"/etc/ld.so.conf.d
+}
+
+pkg_postinst() {
+ target_is_not_host && return 0
+
+ [ -n "${ROOT}" ] && return 0
+
+ ldconfig || die
+}
diff --git a/sys-libs/musl/musl-1.2.5-r1.ebuild b/sys-libs/musl/musl-1.2.5-r1.ebuild
new file mode 100644
index 000000000000..9d233979f7e2
--- /dev/null
+++ b/sys-libs/musl/musl-1.2.5-r1.ebuild
@@ -0,0 +1,207 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev flag-o-matic toolchain-funcs prefix
+
+DESCRIPTION="Light, fast and, simple C library focused on standards-conformance and safety"
+HOMEPAGE="https://musl.libc.org"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://git.musl-libc.org/git/musl"
+ inherit git-r3
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/musl.asc
+ inherit verify-sig
+
+ SRC_URI="https://musl.libc.org/releases/${P}.tar.gz"
+ SRC_URI+=" verify-sig? ( https://musl.libc.org/releases/${P}.tar.gz.asc )"
+ KEYWORDS="-* ~riscv"
+ #KEYWORDS="-* ~amd64 ~arm ~arm64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~x86"
+
+ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-musl )"
+fi
+
+GETENT_COMMIT="93a08815f8598db442d8b766b463d0150ed8e2ab"
+GETENT_FILE="musl-getent-${GETENT_COMMIT}.c"
+SRC_URI+="
+ https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+ https://gitlab.alpinelinux.org/alpine/aports/-/raw/${GETENT_COMMIT}/main/musl/getent.c -> ${GETENT_FILE}
+ https://dev.gentoo.org/~blueness/musl-misc/iconv.c
+"
+
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="crypt headers-only split-usr"
+
+QA_SONAME="usr/lib/libc.so"
+QA_DT_NEEDED="usr/lib/libc.so"
+# bug #830213
+QA_PRESTRIPPED="usr/lib/crtn.o"
+
+# We want crypt on by default for this as sys-libs/libxcrypt isn't (yet?)
+# built as part as crossdev. Also, elide the blockers when in cross-*,
+# as it doesn't make sense to block the normal CBUILD libxcrypt at all
+# there when we're installing into /usr/${CHOST} anyway.
+if is_crosspkg ; then
+ IUSE="${IUSE/crypt/+crypt}"
+else
+ RDEPEND="crypt? ( !sys-libs/libxcrypt[system] )"
+ PDEPEND="!crypt? ( sys-libs/libxcrypt[system] )"
+fi
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.2.4-arm64-crti-alignment.patch
+)
+
+just_headers() {
+ use headers-only && target_is_not_host
+}
+
+pkg_setup() {
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-musl*) ;;
+ *) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+ esac
+ fi
+
+ # Fix for bug #667126, copied from glibc ebuild:
+ # make sure host make.conf doesn't pollute us
+ if target_is_not_host || tc-is-cross-compiler ; then
+ CHOST=${CTARGET} strip-unsupported-flags
+ fi
+}
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ elif use verify-sig ; then
+ # We only verify the release; not the additional (fixed, safe) files
+ # we download.
+ # (Seem to get IPC error on verifying in cross?)
+ ! target_is_not_host && verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}
+ fi
+
+ default
+}
+
+src_prepare() {
+ default
+
+ mkdir "${WORKDIR}"/misc || die
+ cp "${DISTDIR}"/getconf.c "${WORKDIR}"/misc/getconf.c || die
+ cp "${DISTDIR}/${GETENT_FILE}" "${WORKDIR}"/misc/getent.c || die
+ cp "${DISTDIR}"/iconv.c "${WORKDIR}"/misc/iconv.c || die
+}
+
+src_configure() {
+ strip-flags && filter-lto # Prevent issues caused by aggressive optimizations & bug #877343
+ tc-getCC ${CTARGET}
+
+ just_headers && export CC=true
+
+ local sysroot
+ target_is_not_host && sysroot=/usr/${CTARGET}
+ ./configure \
+ --target=${CTARGET} \
+ --prefix="${EPREFIX}${sysroot}/usr" \
+ --syslibdir="${EPREFIX}${sysroot}/lib" \
+ --disable-gcc-wrapper || die
+}
+
+src_compile() {
+ emake obj/include/bits/alltypes.h
+ just_headers && return 0
+
+ emake
+ if ! is_crosspkg ; then
+ emake -C "${T}" getconf getent iconv \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ VPATH="${WORKDIR}/misc"
+ fi
+
+ $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -c -o libssp_nonshared.o "${FILESDIR}"/stack_chk_fail_local.c || die
+ $(tc-getAR) -rcs libssp_nonshared.a libssp_nonshared.o || die
+}
+
+src_install() {
+ local target="install"
+ just_headers && target="install-headers"
+ emake DESTDIR="${D}" ${target}
+ just_headers && return 0
+
+ # musl provides ldd via a sym link to its ld.so
+ local sysroot=
+ target_is_not_host && sysroot=/usr/${CTARGET}
+ local ldso=$(basename "${ED}${sysroot}"/lib/ld-musl-*)
+ dosym -r "${sysroot}/lib/${ldso}" "${sysroot}/usr/bin/ldd"
+
+ if ! use crypt ; then
+ # Allow sys-libs/libxcrypt[system] to provide it instead
+ rm "${ED}/usr/include/crypt.h" || die
+ rm "${ED}/usr/$(get_libdir)/libcrypt.a" || die
+ fi
+
+ if ! is_crosspkg ; then
+ # Fish out of config:
+ # ARCH = ...
+ # SUBARCH = ...
+ # and print $(ARCH)$(SUBARCH).
+ local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
+
+ # The musl build system seems to create a symlink:
+ # ${D}/lib/ld-musl-${arch}.so.1 -> /usr/lib/libc.so.1 (absolute)
+ # During cross or within prefix, there's no guarantee that the host is
+ # using musl so that file may not exist. Use a relative symlink within
+ # ${D} instead.
+ rm "${ED}"/lib/ld-musl-${arch}.so.1 || die
+ if use split-usr; then
+ dosym ../usr/lib/libc.so /lib/ld-musl-${arch}.so.1
+ # If it's still a dead symlink, OK, we really do need to abort.
+ [[ -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] || die
+ else
+ dosym libc.so /usr/lib/ld-musl-${arch}.so.1
+ [[ -e "${ED}"/usr/lib/ld-musl-${arch}.so.1 ]] || die
+ fi
+
+ cp "${FILESDIR}"/ldconfig.in-r3 "${T}"/ldconfig.in || die
+ sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
+ eprefixify "${T}"/ldconfig
+ into /
+ dosbin "${T}"/ldconfig
+ into /usr
+ dobin "${T}"/getconf
+ dobin "${T}"/getent
+ dobin "${T}"/iconv
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
+ doenvd "${T}"/00musl
+ fi
+
+ if target_is_not_host ; then
+ into /usr/${CTARGET}
+ dolib.a libssp_nonshared.a
+ else
+ dolib.a libssp_nonshared.a
+ fi
+}
+
+pkg_preinst() {
+ # Nothing to do if just installing headers
+ just_headers && return
+
+ # Prepare /etc/ld.so.conf.d/ for files
+ mkdir -p "${EROOT}"/etc/ld.so.conf.d
+}
+
+pkg_postinst() {
+ target_is_not_host && return 0
+
+ [[ -n "${ROOT}" ]] && return 0
+
+ ldconfig || die
+}