diff options
Diffstat (limited to 'main/musl/APKBUILD')
-rw-r--r-- | main/musl/APKBUILD | 75 |
1 files changed, 35 insertions, 40 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD index 8c3d71ec27a..5f40cc7da30 100644 --- a/main/musl/APKBUILD +++ b/main/musl/APKBUILD @@ -1,26 +1,25 @@ # Contributor: Ariadne Conill <ariadne@dereferenced.org> -# Maintainer: Timo Teräs <timo.teras@iki.fi> +# Contributor: Timo Teräs <timo.teras@iki.fi> +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=musl -pkgver=1.2.3 +pkgver=1.2.5 pkgrel=0 pkgdesc="the musl c library (libc) implementation" url="https://musl.libc.org/" arch="all" license="MIT" -options="lib64" +options="lib64 !check" subpackages=" $pkgname-dbg $pkgname-libintl:libintl:noarch $pkgname-dev - libc6-compat:compat:noarch " case "$BOOTSTRAP" in nocc) pkgname="musl-dev"; subpackages="";; nolibc) ;; *) subpackages="$subpackages $pkgname-utils";; esac -_commit="v1.2.3" -source="musl-$_commit.tar.gz::https://git.musl-libc.org/cgit/musl/snapshot/$_commit.tar.gz +source="https://musl.libc.org/releases/musl-$pkgver.tar.gz handle-aux-at_base.patch ldconfig @@ -29,6 +28,8 @@ source="musl-$_commit.tar.gz::https://git.musl-libc.org/cgit/musl/snapshot/$_com getent.c iconv.c " +# this is needed for BOOTSTRAP=nocc (see above) +builddir="$srcdir/musl-$pkgver" # secfixes: # 1.2.2_pre2-r0: @@ -38,24 +39,36 @@ source="musl-$_commit.tar.gz::https://git.musl-libc.org/cgit/musl/snapshot/$_com # 1.1.15-r4: # - CVE-2016-8859 -builddir="$srcdir"/$_commit +prepare() { + default_prepare + + echo "$pkgver" > VERSION +} build() { [ "$BOOTSTRAP" = "nocc" ] && return 0 # provide minimal libssp_nonshared.a so we don't need libssp from gcc - ${CROSS_COMPILE}gcc $CPPFLAGS $CFLAGS -c "$srcdir"/__stack_chk_fail_local.c -o __stack_chk_fail_local.o + ${CROSS_COMPILE}cc $CFLAGS -c "$srcdir"/__stack_chk_fail_local.c -o __stack_chk_fail_local.o ${CROSS_COMPILE}ar r libssp_nonshared.a __stack_chk_fail_local.o if [ "$BOOTSTRAP" != "nolibc" ]; then # getconf/getent/iconv local i for i in getconf getent iconv ; do - ${CROSS_COMPILE}gcc $CPPFLAGS $CFLAGS "$srcdir"/$i.c -o $i + ${CROSS_COMPILE}cc $CPPFLAGS $CFLAGS "$srcdir"/$i.c -o $i done fi + # musl sets a sane default for flags that they tune based on -O2 with alignment things turned off. + # see https://git.musl-libc.org/cgit/musl/commit/?id=b90841e2583237a4132bbbd74752e0e9563660cd , + # and the discussion in https://www.openwall.com/lists/musl/2023/05/22/2 + # this makes libc.so about 5% bigger in itself, but should yield an overall improved libc.so for general use. + # NB: if musl detects an -O it skips its own, so remove just the O value + export CFLAGS="${CFLAGS/-O* /}" + # note: not autotools + # shellcheck disable=2153 LDFLAGS="$LDFLAGS -Wl,-soname,libc.musl-$CARCH.so.1" \ ./configure \ --build=$CBUILD \ @@ -65,8 +78,7 @@ build() { --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstatedir=/var \ - --enable-debug \ - --disable-eh-frame + --enable-debug make } @@ -82,6 +94,7 @@ package() { mips64*) ARCH="mips64" ;; mips*) ARCH="mips" ;; riscv64) ARCH="riscv64" ;; + loongarch64) ARCH="loongarch64" ;; esac if [ "$BOOTSTRAP" = "nocc" ]; then @@ -92,7 +105,8 @@ package() { cp libssp_nonshared.a "$pkgdir"/usr/lib # make LDSO the be the real file, and libc the symlink - local LDSO=$(make -f Makefile --eval "$(echo -e 'print-ldso:\n\t@echo $$(basename $(LDSO_PATHNAME))')" print-ldso) + local rule="$(printf "%s\n\t%s\n" 'print-ldso:' '@echo $$(basename $(LDSO_PATHNAME))')" + local LDSO=$(make -f Makefile --eval "$rule" print-ldso) mv -f "$pkgdir"/usr/lib/libc.so "$pkgdir"/lib/"$LDSO" ln -sf "$LDSO" "$pkgdir"/lib/libc.musl-$CARCH.so.1 ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/lib/libc.so @@ -110,7 +124,10 @@ package() { utils() { depends="scanelf" replaces="libiconv" - license="MIT BSD GPL2+" + license="MIT AND BSD-2-Clause AND GPL-2.0-or-later" + + # for backwards compatibility + provides="libc-utils=$pkgver-r$pkgrel" mkdir -p "$subpkgdir"/usr "$subpkgdir"/sbin mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ @@ -134,37 +151,15 @@ libintl() { "$subpkgdir"/usr/include/ } -compat() { - pkgdesc="compatibility libraries for glibc" - - mkdir -p "$subpkgdir"/lib - # definitive source is https://sourceware.org/glibc/wiki/ABIList - case "$CARCH" in - aarch64) _ld="lib/ld-linux-aarch64.so.1" ;; - armel) _ld="lib/ld-linux.so.3" ;; - armhf) _ld="lib/ld-linux-armhf.so.3" ;; - armv7) _ld="lib/ld-linux-armhf.so.3" ;; - mips) _ld="lib/ld.so.1" ;; - mips64) _ld="lib64/ld.so.1" ;; - mipsel) _ld="lib/ld.so.1" ;; - mips64el) _ld="lib64/ld.so.1" ;; - ppc) _ld="lib/ld.so.1" ;; - ppc64) _ld="lib64/ld64.so.1" ;; - ppc64le) _ld="lib64/ld64.so.2" ;; - s390x) _ld="lib/ld64.so.1" ;; - x86) _ld="lib/ld-linux.so.2" ;; - x86_64) _ld="lib64/ld-linux-x86-64.so.2";; - esac - mkdir -p "$subpkgdir/${_ld%/*}" - ln -sf "/lib/libc.musl-$CARCH.so.1" "$subpkgdir/$_ld" +dev() { + default_dev - for i in libc.so.6 libcrypt.so.1 libm.so.6 libpthread.so.0 librt.so.1 libutil.so.1; do - ln -sf "/lib/libc.musl-$CARCH.so.1" "$subpkgdir/lib/$i" - done + # for backwards compatibility + provides="libc-dev=$pkgver-r$pkgrel" } sha512sums=" -9a1b8f9208d99582ac00e3c46c829aa1fad3b7f09aa7d6822f02f25542453d3d977c69519ad01430b8dd624ac9dc70f47d611e36aefd7fef31ea47a7679e3111 musl-v1.2.3.tar.gz +7bb7f7833923cd69c7a1a9b8a5f1784bfd5289663eb6061dcd43d583e45987df8a68a1be05d75cc1c88a3f5b610653d1a70f4a9cff4d8f7fd41ae73ee058c17c musl-1.2.5.tar.gz a76f79b801497ad994746cf82bb6eaf86f9e1ae646e6819fbae8532a7f4eee53a96ac1d4e789ec8f66aea2a68027b0597f7a579b3369e01258da8accfce41370 handle-aux-at_base.patch 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c |