summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-11-10 03:31:26 +0000
committerSam James <sam@gentoo.org>2021-11-10 03:32:25 +0000
commita4957cb794dce725b4801ee16a36f38526bdce2d (patch)
treef593d38683c141b82ab488f9134e68316c2bcf32 /sys-libs/musl/musl-9999.ebuild
parentsys-libs/ncurses: add 6.3_p20211106 (unkeyworded; for cross/bootstrap testing) (diff)
downloadgentoo-a4957cb794dce725b4801ee16a36f38526bdce2d.tar.gz
gentoo-a4957cb794dce725b4801ee16a36f38526bdce2d.tar.bz2
gentoo-a4957cb794dce725b4801ee16a36f38526bdce2d.zip
sys-libs/musl: create relative symlink to libc.so if existing one fails
The build system seems to create an absolute symlink to libc.so on the host which may not exist. If it doesn't (to avoid being disruptive, we could do this unconditionally), create a new one relative within ${D} to facilitate SYSROOT installs. I've hit this a few times when using crossdev but finally dug into it a bit more. Bug: https://bugs.gentoo.org/732482 Signed-off-by: Sam James <sam@gentoo.org>
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 /