aports/main/scudo-malloc/APKBUILD
2025-05-08 07:06:52 +00:00

60 lines
1.8 KiB
Text

# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=scudo-malloc
# tied to llvm version
pkgver=20.1.4
pkgrel=0
pkgdesc="Standalone scudo malloc from compiler-rt"
url="https://llvm.org"
arch="all"
license="Apache-2.0 WITH LLVM-exception"
provider_priority=100 # highest
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="linux-headers"
checkdepends="gtest-dev"
subpackages="$pkgname-static $pkgname-dev"
source="https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver//_/-}/compiler-rt-${pkgver//_/}.src.tar.xz
0001-Add-makefile.patch
"
builddir="$srcdir/compiler-rt-${pkgver//_/}.src/lib/scudo/standalone"
case "$CARCH" in
ppc64le)
# tests/common_test.cpp:33: Failure
# Expected: (OnStart) > (0UL), actual: 0 vs 0
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/16235
options="!check"
;;
esac
build() {
local cflags_crc32=
unset CXXFLAGS
case "$CARCH" in
aarch64)
# this has broken emulation in aarch64 qemu (incl qemu-user),
# which causes it to abort instantly
CXXFLAGS="-DSCUDO_DISABLE_TBI"
cflags_crc32="-march=armv8-a+crc"
;;
x86*) cflags_crc32="-mcrc32"
;;
esac
msg "building libscudo"
make CXXFLAGS="$CXXFLAGS" CXXFLAGS_crc32="$cflags_crc32" TESTS="$(want_check && echo yes || echo no)"
}
check() {
make test
}
package() {
install -Dm755 libscudo.so -t "$pkgdir"/usr/lib/
install -Dm644 libscudo.a -t "$pkgdir"/usr/lib/
install -Dm644 include/scudo/interface.h -t "$pkgdir"/usr/include/scudo/
}
sha512sums="
0e33463102d5859beaa39893706b1221d1661db25013d2df22d6884958cd9a23e7ed5c51149a13ef5fd3cb6e716b4b09b16dac788b613bdd76ee70ef1af528a7 compiler-rt-20.1.4.src.tar.xz
1102a512adde2ef31aafa6011a4293d5fa361aa920f88ac20599aab84711e973315e6f6719631be11007aea869ae700e34ed57c7dc7724e8aacbc5b493632849 0001-Add-makefile.patch
"