AtlatestRepositorycore-channel
core-channel / tree / src / patchesmusl-relative-ldso-symlink.patch
1
Make the dynamic-loader symlink RELATIVE to its own directory.3
musl installs lib/ld-musl-x86_64.so.1 as a symlink to $(libdir)/libc.so, an4
ABSOLUTE path. In this channel $(libdir) is the package's own store prefix,5
/sigil/store/<item>/lib, which exists only inside the build sandbox. The6
sandbox assembly runs on the HOST, before the chroot, so it must be able to7
resolve the loader from outside: an absolute self-referential symlink is8
dangling there and cannot be bind-mounted.10
A relative symlink names the sibling file and therefore resolves identically11
from both sides. Nothing else changes; the installed loader still points at12
the same libc.so.14
--- a/Makefile15
+++ b/Makefile16
@@ -210,7 +210,7 @@17
$(INSTALL) -D -m 644 $< $@19
$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so20
- $(INSTALL) -D -l $(libdir)/libc.so $@ || true21
+ $(INSTALL) -D -l libc.so $@ || true23
install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)