summaryrefslogtreecommitdiff
path: root/sys-libs/musl
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /sys-libs/musl
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'sys-libs/musl')
-rw-r--r--sys-libs/musl/Manifest6
-rw-r--r--sys-libs/musl/files/ldconfig.in-r3160
-rw-r--r--sys-libs/musl/musl-1.2.2-r7.ebuild4
-rw-r--r--sys-libs/musl/musl-1.2.2-r8.ebuild156
-rw-r--r--sys-libs/musl/musl-9999.ebuild46
5 files changed, 343 insertions, 29 deletions
diff --git a/sys-libs/musl/Manifest b/sys-libs/musl/Manifest
index f3b72199bd96..b6ac7c1b2204 100644
--- a/sys-libs/musl/Manifest
+++ b/sys-libs/musl/Manifest
@@ -1,6 +1,7 @@
AUX ldconfig.in 2552 BLAKE2B c94f9900e8582d707519171c4b61079c801b60c555677b1740b04adbdec9645578b9a8fc91f11413072568f316c795e46a332970f3d2dde5272b0c49a5d60a78 SHA512 59f1b57361196363d3f127366764f05d26c23dbe3d3dbcdba9bd3c8ca26a671fd713b96d31c509d22805c57ada2b596d979a3f5795bcf0a4d3ac7d168f3bf377
AUX ldconfig.in-r1 2930 BLAKE2B a0b0d4715d9b4c83c4e7036d466dae854c2da1e2393a48cf1c05789a59426f6809118d5ac266a7eb558010c8c47d344b93c8c86847d9d0158d3885b6076e3bf6 SHA512 7e5b5e396965c7e677168f0974460565dd0302639835ca7b0fbf1198e911dc2818dd64424e0e217a710545cbeeb4c31877f05034f16737a822eb02520c258c4e
AUX ldconfig.in-r2 2970 BLAKE2B a6b93ebbbe0caa07a1d32af07d810e1d95d47f2246573e77dfd14edba4403a9d90fd92a7428754c68036ffdbc7e82b926d95538f6617a76a247ab5c9a3c3ba1b SHA512 5b97f473ead0def43656b42511af77c427237e6c36f8d2afad8241ef4e948ed5f0a58dc9e65205c393b530ac810ee1e9f2db008534707283bca0fac2951fe4f9
+AUX ldconfig.in-r3 3093 BLAKE2B 146374fe711c660a61e4a23f89ae066e78b8bca6884719c058981069ab92833d7f660b7bd78e7c8b86112944706823f0260d7c63f19d64960f27f44b4e95a6a3 SHA512 ba021cf7d52c001d6ef9a54a91de93240cd7eef9f7a6d7a48ae0c58f934aaea6796979ce80e1cfa9bdc6008023108f3c226440360f8e3134fc23f7fdac0e55b1
AUX musl-1.2.2-gethostid.patch 1028 BLAKE2B fbe554e681c8f0e4bff6ec6fe97c88fd3c7f84ac07580b5f6cfef13b6b27c985f4f0e1d7722f397c59e655b8cd864fa845f9af2aa0eaa9287349f41e71f7a257 SHA512 d2959ef272e3a2742efec3983a41705cfa6424110dbc1eb53a912492cf067881cdbcb8cd864757e6450dda9b47e0cca7dbe3a86d3e6e74e7f33fb7d1723edfde
AUX stack_chk_fail_local.c 1798 BLAKE2B 380bcbb920bd40a5185246621ba93716f27d61cd0077cd796ff267e10c534c9cc64982b2a66c89b61395dc93d67dae77e8c59908f65f2903f16016180cf94bbb SHA512 bb0bdd7f205d57771920c7ea898c1f84a55d6f90ddd1f8203bfeed98d13ccefa6f68d5fd1c0761321b2732ca928ca81b425e3fe8321c936d1316dea6f1930091
DIST getconf.c 11614 BLAKE2B ba49a573fc16d51780a0b0b81fbf7b64a1142f1dbad203c9609a59b6b07e7404f676c415383ae88c0aede95694821f6ee381bffd93cc3330501e17dc07d122bd SHA512 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d
@@ -10,6 +11,7 @@ DIST musl-getent-93a08815f8598db442d8b766b463d0150ed8e2ab.c 11656 BLAKE2B 1b7bf7
EBUILD musl-1.2.2-r3.ebuild 3814 BLAKE2B 037af7d810ace77441369b4dc9a8513298167bbe7af7a010ad22f6ff7e99aba2cac0b6b8befd51f080fb3c695452ec7a3cecbdeb46cbfd06d2aef2415a96c28e SHA512 48cb68039a1cc61b230d2c9b549f01c40607ef2a0726589e558e412311f7e1ae988c7328f86b61b148ba88f2f107c72b2829ccd8ba16567a52a3840f2286d477
EBUILD musl-1.2.2-r4.ebuild 4442 BLAKE2B 1cfdf66f7c975e164161cb90d98f20187c2d3ae0a24914206222c7255714a2cd10c4034a6b34018e3c79a2ec6385012c29f39d525ab83ab9b737a04453232e65 SHA512 340f60f7f73702510251a1df1af6a38af715678bad3606aab1e29c132bf5bb5805c39d916a1ff95c5e492a38b1d9a2ba3ae24560287d2fca647aa338eede2de7
EBUILD musl-1.2.2-r6.ebuild 4457 BLAKE2B 9fde176fc9b78c29480eb8aa85a1b9decd777976c6c44ca298762fb1dd71ee8144a6dede69d82b69eebad48990b8da4522df2818370aac5dc8c7a1436172154c SHA512 fedb1929ffd0f6282c9103567b1f7813b4da523fdfe678cdce3792c8bdb2b866decccb57c4850eb92e6161894ad9409fb3b9b0fe477f8520cefecb3844bbc5b3
-EBUILD musl-1.2.2-r7.ebuild 4463 BLAKE2B 783ce34e051c909cca45ac6577e79e81e113b2e4741ddbd579633faad3e0064ad7a82c45aa100b2f4c2a85cdaf5a8cdeefdf1f832e91e5262a786c7ac556d284 SHA512 03f6e12bf862699aa36b84461341e820099e0bc5fa8115c346cdf95f8ddf4863a12807ebb62116c6fe48072e1dd9738b4a937e2ef60ec8701b1d36c387e8b44b
-EBUILD musl-9999.ebuild 4335 BLAKE2B 4b7c55d401e0587f0443050725d6d4dcdce87391eb6963f1078a77eb51af3240431bdb473cac170cd189c55a12c63081391963b3de728cdfa4357968497d66ad SHA512 ef20494c520d27827074899dca61691e722921fecadc83c021b6cf0ec4f73a709d072adb2ccd0590bfa3f0371888afc32b0a6a61a3a9aae6a995f9a12ccf676d
+EBUILD musl-1.2.2-r7.ebuild 4457 BLAKE2B 377ee3688dcd2d84bc6d3fc951e5cf158db7a90199a539ecabfc3a5e74294251903ee0097473ad778578bf9e4157e1339dd6955934f78e99b638049380b5cd92 SHA512 95c9be188d0bdb1a550d0b99b36075d67d989211a4890486a60b88becbe30f03cf45102d3e5172a38246c12c9878b90e145438f9f2cddc8a0e61e535935488ca
+EBUILD musl-1.2.2-r8.ebuild 4237 BLAKE2B abe89f9e3a6a1f1b47d6dd7b5dc3118c6fa059597b814422320b15188ecb7b0bf440fedd14f6cf1af58a300c37b198736f11068cdfef3ea29691c9b35d50ebdf SHA512 ad2f5fa359f22e494a63fc9968dba2e25b418a67987e8ca9e4c9d930b0beb041b11d721d9779d6a7cb0b1f074b70504e702cf5d4eefc3a28699f8517fafc8f8d
+EBUILD musl-9999.ebuild 4237 BLAKE2B abe89f9e3a6a1f1b47d6dd7b5dc3118c6fa059597b814422320b15188ecb7b0bf440fedd14f6cf1af58a300c37b198736f11068cdfef3ea29691c9b35d50ebdf SHA512 ad2f5fa359f22e494a63fc9968dba2e25b418a67987e8ca9e4c9d930b0beb041b11d721d9779d6a7cb0b1f074b70504e702cf5d4eefc3a28699f8517fafc8f8d
MISC metadata.xml 559 BLAKE2B 8b1093a5278f716b8e21467b325e373a790f54c8ab71b92adc4c87dd569a92b20e08009372065f0f27ced39e3361c9e5e5a2e1bff271753d280439fabbddd3a4 SHA512 a35c13ea32ac8f26984bdb0d70d28a4285f34e32a2b0b17ad98fe3f357fb46c87a1e853377630d4da58fd5953de3fdeb02ee89181394e1815f5e0bbba4cd9f92
diff --git a/sys-libs/musl/files/ldconfig.in-r3 b/sys-libs/musl/files/ldconfig.in-r3
new file mode 100644
index 000000000000..60f6cc9e1130
--- /dev/null
+++ b/sys-libs/musl/files/ldconfig.in-r3
@@ -0,0 +1,160 @@
+#!/bin/bash -e
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+ROOT="/"
+EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+LDSO_CONF_FILE="/etc/ld.so.conf"
+
+VERBOSE=0
+
+UPDATE_LINKS=1
+
+get_options() {
+ LDSO_CONF=""
+ while getopts "vnNXf:C:r:p" opt "$@"; do
+ case $opt in
+ v)
+ echo "ldconfig for musl in Gentoo"
+ VERBOSE=1
+ ;;
+ r)
+ ROOT=${OPTARG}
+ ;;
+ f)
+ LDSO_CONF=${OPTARG}
+ ;;
+ X)
+ UPDATE_LINKS=0
+ ;;
+ \?)
+ echo "Invalid option: -${opt}" >&2
+ exit 1
+ ;;
+ n|N|C|p)
+ echo "Unimplemented option: -${opt}" >&2
+ exit 1
+ ;;
+ esac
+ done
+ if [[ -z ${LDSO_CONF} ]]; then
+ LDSO_CONF=${ROOT}${EPREFIX}${LDSO_CONF_FILE}
+ fi
+
+ if [[ ${UPDATE_LINKS} == 1 ]]; then
+ echo "Updating links is not implemented."
+ fi
+}
+
+
+repeated() {
+ local l=${1}
+ local drs="${@:2}"
+ for m in ${drs}; do
+ [[ ${m} == ${l} ]] && return 0
+ done
+ return 1
+}
+
+expand() {
+ # We are assuming the ld.so.conf's 'include' is not recursive
+ local f line l
+ local glob="${LDSO_CONF_DIR}/${1}"
+ local drs="${@:2} "
+
+ for f in ${glob}; do
+ [[ ! -f ${f} ]] && continue
+ while read line; do
+ line=${line%%#*}
+ line=${line//:/ }
+ line=${line//,/ }
+ for l in ${line}; do
+ # We must add this whether or not the directory exists
+ repeated ${l} ${drs} && continue
+ drs+=" ${l} "
+ done
+ done < ${f}
+ done
+
+ echo ${drs}
+}
+
+read_ldso_conf() {
+ local drs=" "
+
+ while read line; do
+ # Sanitize the line - see ldconfig(8) for delimiters
+ # Note: bash read turns tabs into spaces and read already
+ # delimits on newlines with the default $IFS
+ line=${line%%#*} # Remove comments
+ line=${line//:/ } # Change colon delimiter to space
+ line=${line//,/ } # Change comma delimiter to space
+
+ next=0
+ for l in ${line}; do
+ if [[ ${next} == 1 ]]; then
+ next=0
+ drs=$(expand ${l} ${drs})
+ elif [[ ${l} == "include" ]]; then
+ next=1
+ else
+ # glibc's ldconfig silently skips non directories
+ if [[ -d ${l} ]]; then
+ repeated ${l} ${drs} && continue
+ drs+=" ${l} "
+ fi
+ fi
+ done
+ done < ${1}
+
+ echo ${drs}
+}
+
+sanitize() {
+ local drs=$@
+
+ repeated "${EPREFIX}/lib" ${drs} || drs="${EPREFIX}/lib ${drs}"
+ repeated "${EPREFIX}/usr/lib" ${drs} || drs="${EPREFIX}/usr/lib ${drs}"
+
+ echo ${drs}
+}
+
+changed() {
+ [[ -f ${ETC_LDSO_PATH} ]] || return 0
+ local current=$(<${ETC_LDSO_PATH})
+ current=${current//$'\n'/ }
+ [[ ${current} != ${drs} ]] || return 1
+}
+
+get_options "$@"
+
+if [[ ! -e ${LDSO_CONF} ]]; then
+ echo "${LDSO_CONF} not found" >&2
+ exit 1
+fi
+
+LDSO_CONF_DIR=$(dirname ${LDSO_CONF})
+
+drs=$(read_ldso_conf "${LDSO_CONF}")
+drs=$(sanitize ${drs})
+
+ARCH=@@ARCH@@
+LDSO_PATH="${ROOT}${EPREFIX}/lib/ld-musl-${ARCH}.so.1"
+if [[ ! -e ${LDSO_PATH} ]]; then
+ echo "${LDSO_PATH} not found" >&2
+ exit 1
+fi
+
+LDSO_ARCH=$(basename ${LDSO_PATH})
+LDSO_NAME=${LDSO_ARCH%.so.1}
+ETC_LDSO_PATH="${ROOT}${EPREFIX}/etc/${LDSO_NAME}.path"
+
+changed || exit 0
+X=$(mktemp -p /tmp ${LDSO_NAME}.XXXXXX)
+for d in ${drs}; do
+ echo ${d} >> ${X}
+done
+chmod 644 ${X}
+# busybox doesn't support mz -Z
+cp ${X} ${ETC_LDSO_PATH}
+rm ${X}
diff --git a/sys-libs/musl/musl-1.2.2-r7.ebuild b/sys-libs/musl/musl-1.2.2-r7.ebuild
index dac76c213424..e03ad57480ff 100644
--- a/sys-libs/musl/musl-1.2.2-r7.ebuild
+++ b/sys-libs/musl/musl-1.2.2-r7.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -9,7 +9,7 @@ if [[ ${PV} == "9999" ]] ; then
inherit git-r3
else
SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz"
- KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86"
+ KEYWORDS="-* amd64 arm arm64 ~mips ppc ppc64 x86"
fi
GETENT_COMMIT="93a08815f8598db442d8b766b463d0150ed8e2ab"
GETENT_FILE="musl-getent-${GETENT_COMMIT}.c"
diff --git a/sys-libs/musl/musl-1.2.2-r8.ebuild b/sys-libs/musl/musl-1.2.2-r8.ebuild
new file mode 100644
index 000000000000..34fc6172b105
--- /dev/null
+++ b/sys-libs/musl/musl-1.2.2-r8.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit eapi8-dosym flag-o-matic toolchain-funcs prefix
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.musl-libc.org/musl"
+ inherit git-r3
+else
+ SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz"
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~riscv ~x86"
+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
+"
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+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="headers-only"
+
+QA_SONAME="/usr/lib/libc.so"
+QA_DT_NEEDED="/usr/lib/libc.so"
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+ use headers-only && is_crosscompile
+}
+
+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 is_crosscompile || tc-is-cross-compiler ; then
+ CHOST=${CTARGET} strip-unsupported-flags
+ fi
+}
+
+src_unpack() {
+ if [[ ${PV} == 9999 ]]; then
+ git-r3_src_unpack
+ else
+ unpack "${P}.tar.gz"
+ fi
+ mkdir misc || die
+ cp "${DISTDIR}"/getconf.c misc/getconf.c || die
+ cp "${DISTDIR}/${GETENT_FILE}" misc/getent.c || die
+ cp "${DISTDIR}"/iconv.c misc/iconv.c || die
+}
+
+src_configure() {
+ tc-getCC ${CTARGET}
+ just_headers && export CC=true
+
+ local sysroot
+ is_crosscompile && 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 [[ ${CATEGORY} != cross-* ]] ; 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
+ is_crosscompile && sysroot=/usr/${CTARGET}
+ local ldso=$(basename "${ED}"${sysroot}/lib/ld-musl-*)
+ dosym ${EPREFIX}${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+
+ if [[ ${CATEGORY} != cross-* ]] ; 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 -f "${ED}"/lib/ld-musl-${arch}.so.1 || die
+ dosym8 -r /usr/lib/libc.so /lib/ld-musl-${arch}.so.1
+
+ # If it's still a dead symlnk, OK, we really do need to abort.
+ [[ -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] || die
+
+ 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
+ dolib.a libssp_nonshared.a
+ fi
+}
+
+pkg_postinst() {
+ is_crosscompile && return 0
+
+ [ "${ROOT}" != "/" ] && return 0
+
+ ldconfig || die
+}
diff --git a/sys-libs/musl/musl-9999.ebuild b/sys-libs/musl/musl-9999.ebuild
index 6a5e2688dd5a..34fc6172b105 100644
--- a/sys-libs/musl/musl-9999.ebuild
+++ b/sys-libs/musl/musl-9999.ebuild
@@ -1,15 +1,15 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-inherit eapi8-dosym flag-o-matic toolchain-funcs
+inherit eapi8-dosym flag-o-matic toolchain-funcs prefix
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://git.musl-libc.org/musl"
inherit git-r3
else
SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz"
- KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86"
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~riscv ~x86"
fi
GETENT_COMMIT="93a08815f8598db442d8b766b463d0150ed8e2ab"
GETENT_FILE="musl-getent-${GETENT_COMMIT}.c"
@@ -76,11 +76,11 @@ src_configure() {
just_headers && export CC=true
local sysroot
- is_crosscompile && sysroot="${EPREFIX}"/usr/${CTARGET}
+ is_crosscompile && sysroot=/usr/${CTARGET}
./configure \
--target=${CTARGET} \
- --prefix=${sysroot}/usr \
- --syslibdir=${sysroot}/lib \
+ --prefix=${EPREFIX}${sysroot}/usr \
+ --syslibdir=${EPREFIX}${sysroot}/lib \
--disable-gcc-wrapper || die
}
@@ -111,8 +111,8 @@ src_install() {
# musl provides ldd via a sym link to its ld.so
local sysroot
is_crosscompile && sysroot=/usr/${CTARGET}
- local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
- dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+ local ldso=$(basename "${ED}"${sysroot}/lib/ld-musl-*)
+ dosym ${EPREFIX}${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
if [[ ${CATEGORY} != cross-* ]] ; then
# Fish out of config:
@@ -121,24 +121,20 @@ src_install() {
# and print $(ARCH)$(SUBARCH).
local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
- if [[ ! -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] ; then
- # During cross (using crossdev), when emerging sys-libs/musl,
- # if /usr/lib/libc.so.1 doesn't exist on the system, installation
- # would fail.
- #
- # The musl build system seems to create a symlink:
- # ${D}/lib/ld-musl-${arch}.so.1 -> /usr/lib/libc.so.1 (absolute)
- # During cross, there's no guarantee that the host is using musl
- # so that file may not exist. Use a relative symlink within ${D}
- # instead.
- dosym8 -r /usr/lib/libc.so /lib/ld-musl-${arch}.so.1
-
- # If it's still a dead symlnk, OK, we really do need to abort.
- [[ -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] || die
- fi
-
- cp "${FILESDIR}"/ldconfig.in-r1 "${T}"/ldconfig.in || die
+ # 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 -f "${ED}"/lib/ld-musl-${arch}.so.1 || die
+ dosym8 -r /usr/lib/libc.so /lib/ld-musl-${arch}.so.1
+
+ # If it's still a dead symlnk, OK, we really do need to abort.
+ [[ -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] || die
+
+ 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