main/snappy: fix runtime failure on armhf and re-enable check

Ref #8921 (https://bugs.alpinelinux.org/issues/8921)
This commit is contained in:
Jakub Jirutka 2018-05-24 23:17:49 +02:00
parent e6a6453651
commit 634d901257
2 changed files with 20 additions and 4 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=snappy
pkgver=1.1.4
pkgrel=3
pkgrel=4
pkgdesc="Fast compression and decompression library"
url="http://google.github.io/snappy/"
arch="all"
@ -10,9 +10,8 @@ license="BSD-3-Clause"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc"
source="https://github.com/google/snappy/releases/download/$pkgver/snappy-$pkgver.tar.gz
fix-UnalignedCopy64.patch
fix-GetHashTable.patch
"
[ "$CARCH" = "armhf" ] && options="!check" # does not pass testsuite on armhf
builddir="$srcdir/$pkgname-$pkgver"
build() {
@ -34,4 +33,5 @@ package() {
}
sha512sums="4f522f1d541e3f00d82ccaf6dda5c6ede28d4db19c53717003d8057261fe8630516ed6ff2a28615da032e0de9c6200b560ed5fce4f8714df9916d50d6a7c2178 snappy-1.1.4.tar.gz
a086dbdfe2cb21419b33c2f8a2739224a8e843f2c6a51715100c723b9fbd9aed14bcfa791c20dae785b33ac1d1cf4812ed2c5c5d4058c5b8e56a0e004e9a8c60 fix-UnalignedCopy64.patch"
a086dbdfe2cb21419b33c2f8a2739224a8e843f2c6a51715100c723b9fbd9aed14bcfa791c20dae785b33ac1d1cf4812ed2c5c5d4058c5b8e56a0e004e9a8c60 fix-UnalignedCopy64.patch
8db7a634c9147286f01eb4bd0a5ff2138540c06acad5fb77aa2977f7b64a19b91ff0f886f650b0a38834a33895f7a1dd4bcfb93af7f6676d59e3fdb8b6efbea0 fix-GetHashTable.patch"

View File

@ -0,0 +1,16 @@
Fix for armhf.
See: https://groups.google.com/d/msg/snappy-compression/uhELq553TrI/J34d3D8_BwAJ
https://bugs.alpinelinux.org/issues/8921
--- a/snappy.cc
+++ b/snappy.cc
@@ -323,7 +323,7 @@
*table_size = 256;
} else {
// Since table size must be a power of 2, round up to the next power of 2.
- *table_size = 1 << (std::numeric_limits<size_t>::digits -
+ *table_size = 1 << std::max(1, std::numeric_limits<size_t>::digits -
__builtin_clzll(input_size - 1));
}
if (*table_size <= ARRAYSIZE(small_table_)) {