summaryrefslogtreecommitdiff
path: root/sys-libs/musl/musl-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/musl/musl-9999.ebuild')
-rw-r--r--sys-libs/musl/musl-9999.ebuild20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys-libs/musl/musl-9999.ebuild b/sys-libs/musl/musl-9999.ebuild
index 56a2bbbc42f6..5736eadc0fb4 100644
--- a/sys-libs/musl/musl-9999.ebuild
+++ b/sys-libs/musl/musl-9999.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-inherit flag-o-matic toolchain-funcs
+inherit eapi8-dosym flag-o-matic toolchain-funcs
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://git.musl-libc.org/musl"
inherit git-r3
@@ -120,7 +120,23 @@ src_install() {
# SUBARCH = ...
# and print $(ARCH)$(SUBARCH).
local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
- [[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
+
+ if [[ ! -e "${D}"/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.1 /lib/ld-musl-${arch}.so.1
+
+ # If it's still a dead symlnk, OK, we really do need to abort.
+ [[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
+ fi
+
cp "${FILESDIR}"/ldconfig.in "${T}" || die
sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
into /