From 1cdf278fcac4a31f64d7cd87eee8d363bdd3b673 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Tue, 28 Nov 2023 16:10:49 -0800 Subject: [PATCH] Fix musl paths, and add ld --- packages/musl/Dockerfile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/musl/Dockerfile b/packages/musl/Dockerfile index 82a9c56..1e61ceb 100644 --- a/packages/musl/Dockerfile +++ b/packages/musl/Dockerfile @@ -8,7 +8,8 @@ RUN wget ${SRC_SITE}/releases/musl-$SRC_VERSION.tar.gz RUN echo "${SRC_HASH} musl-${SRC_VERSION}.tar.gz" | sha256sum -c RUN tar -xzf musl-${SRC_VERSION}.tar.gz WORKDIR musl-${SRC_VERSION} -RUN set -ex; \ +RUN set -eux; \ + export LDFLAGS="-Wl,-soname,libc.musl-x86_64.so.1"; \ ./configure \ --build=x86_64-linux-musl \ --host=x86_64-linux-musl \ @@ -16,8 +17,19 @@ RUN set -ex; \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ - --localstatedir=/var; \ - make DESTDIR=/home/user/rootfs install; + --localstatedir=/var \ + --enable-debug; \ + make; + +RUN set -eux; \ + make DESTDIR=/home/user/rootfs install; \ + mkdir -p /home/user/rootfs/usr/bin; \ + printf "%s\n%s\n" '#!/bin/sh' 'exec /lib/$LDSO --list "\$@"' \ + > /home/user/rootfs/usr/bin/ldd; \ + chmod 755 /home/user/rootfs/usr/bin/ldd; \ + mv -f /home/user/rootfs/usr/lib/libc.so /home/user/rootfs/lib/ld-musl-x86_64.so.1; \ + ln -sf ld-musl-x86_64.so.1 /home/user/rootfs/lib/libc.musl-x86_64.so.1; \ + ln -sf ../../lib/ld-musl-x86_64.so.1 /home/user/rootfs/usr/lib/libc.so; FROM scratch COPY --from=build /home/user/rootfs /