diff lib/musl/musl.sh @ 1224:d1dbb848c42d

core/musl: upgrade to 1.2.2 While here, provide ARM support and add libs to PKGPRESERVE.
author David Demelier <markand@malikania.fr>
date Fri, 29 Oct 2021 09:58:11 +0200
parents 325631424c65
children 9867e578b1a9
line wrap: on
line diff
--- a/lib/musl/musl.sh	Fri Oct 29 09:06:10 2021 +0200
+++ b/lib/musl/musl.sh	Fri Oct 29 09:58:11 2021 +0200
@@ -15,10 +15,8 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
-# TODO: change x86_64 once we build ARM variants.
-
 PKGNAME=musl
-PKGVERSION=1.1.21
+PKGVERSION=1.2.2
 PKGREVISION=1
 PKGLICENSE="MIT"
 PKGSUMMARY="a new lightweight, fast, simple, free and correct C library"
@@ -33,13 +31,22 @@
 if [ "$STATIC" = "yes" ]; then
 	with_static="--disable-shared"
 else
-	PKGPRESERVE="lib/ld-musl-x86_64.so.1"
+	case $(vpk arch) in
+	aarch64)
+		lib="lib/ld-musl-aarch64.so.1"
+		;;
+	amd64)
+		lib="lib/lib/ld-musl-x86_64.so.1"
+		;;
+	esac
+
+	PKGPRESERVE="lib/libc.so $lib"
 fi
 
 build()
 {
 	rm -rf $PKGNAME-$PKGVERSION
-	tar xvf $PKGNAME-$PKGVERSION.tar.gz
+	tar -xvf $PKGNAME-$PKGVERSION.tar.gz
 	cd $PKGNAME-$PKGVERSION
 
 	CC="$CC" \
@@ -55,7 +62,7 @@
 
 	if [ "$STATIC" != "yes" ]; then
 		mkdir -p $DESTDIR/bin
-		ln -sf /lib/ld-musl-x86_64.so.1 $DESTDIR/bin/ldd
+		ln -sf /$lib $DESTDIR/bin/ldd
 	fi
 
 	cd ..