Control: tag -1 patch

On Thu, 03 Nov 2016 11:31:07 +0000 Antonio Valentino
<antonio.valent...@tiscali.it> wrote:
> Package: libblosc1
> Version: 1.11.1+ds1-2
> Severity: important
> 
> Dear Maintainer,
> it seems that the c-blosc library has some problems withthe bitshuffle filter 
> on big-endian architectures.
> The problem causes several test failures on the pytables package [1, 2,
> 3]
> when tests are run on mips, s390x and other architectures (all bigendian
> it seems).
> 
> The problem has been reported upstream [4, 5] and it is currently under
> investigation.
> If my understanding is correct a quick fix can be implememted by
> pproperly setting build flags but please refer to the upstream [4] for
> more details.
> 
> [1] https://tracker.debian.org/pkg/pytables
> [2] https://buildd.debian.org/status/package.php?p=pytables
> [3]
> https://buildd.debian.org/status/fetch.php?pkg=pytables&arch=mips&ver=3.3.0-3&stamp=1478077059
> [4] https://github.com/Blosc/c-blosc/issues/181
> [5] https://github.com/PyTables/PyTables/issues/583

Please find attached a patch proposal from upsrtream ticket [1].

[1] https://github.com/Blosc/c-blosc/issues/181#issuecomment-258326947

Thanks,

_g.
diff -Nru c-blosc-1.11.1+ds1/debian/changelog 
c-blosc-1.11.1+ds1/debian/changelog
--- c-blosc-1.11.1+ds1/debian/changelog 2016-09-04 13:08:55.000000000 +0200
+++ c-blosc-1.11.1+ds1/debian/changelog 2016-11-04 11:19:43.000000000 +0100
@@ -1,3 +1,11 @@
+c-blosc (1.11.1+ds1-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * New patch bigendian.patch: fix endianness issue in the bitshuffle
+    filter (closes: #8430040)
+
+ -- Gilles Filippini <p...@debian.org>  Fri, 04 Nov 2016 11:19:43 +0100
+
 c-blosc (1.11.1+ds1-2) unstable; urgency=medium
 
   * add preserve-cflags-from-environment.patch.
diff -Nru c-blosc-1.11.1+ds1/debian/patches/bigendian.patch 
c-blosc-1.11.1+ds1/debian/patches/bigendian.patch
--- c-blosc-1.11.1+ds1/debian/patches/bigendian.patch   1970-01-01 
01:00:00.000000000 +0100
+++ c-blosc-1.11.1+ds1/debian/patches/bigendian.patch   2016-11-04 
02:57:31.000000000 +0100
@@ -0,0 +1,38 @@
+Index: c-blosc-1.11.1+ds1/blosc/bitshuffle-generic.h
+===================================================================
+--- c-blosc-1.11.1+ds1.orig/blosc/bitshuffle-generic.h
++++ c-blosc-1.11.1+ds1/blosc/bitshuffle-generic.h
+@@ -39,7 +39,14 @@ extern "C" {
+ 
+ /* Transpose 8x8 bit array packed into a single quadword *x*.
+  * *t* is workspace. */
++#ifdef BSHUF_BIGENDIAN
++# include <byteswap.h>
++# define BSWAP_64(x) x = bswap_64(x)
++#else
++# define BSWAP_64(x)
++#endif
+ #define TRANS_BIT_8X8(x, t) {                                               \
++        BSWAP_64(x)                                                         \
+         t = (x ^ (x >> 7)) & 0x00AA00AA00AA00AALL;                          \
+         x = x ^ t ^ (t << 7);                                               \
+         t = (x ^ (x >> 14)) & 0x0000CCCC0000CCCCLL;                         \
+Index: c-blosc-1.11.1+ds1/blosc/CMakeLists.txt
+===================================================================
+--- c-blosc-1.11.1+ds1.orig/blosc/CMakeLists.txt
++++ c-blosc-1.11.1+ds1/blosc/CMakeLists.txt
+@@ -161,6 +161,14 @@ if(COMPILER_SUPPORT_AVX2)
+         APPEND PROPERTY COMPILE_DEFINITIONS SHUFFLE_AVX2_ENABLED)
+ endif(COMPILER_SUPPORT_AVX2)
+ 
++INCLUDE(TestBigEndian)
++TEST_BIG_ENDIAN(BIGENDIAN)
++IF(BIGENDIAN)
++    set_property(
++        SOURCE bitshuffle-generic.c
++        APPEND PROPERTY COMPILE_DEFINITIONS BSHUF_BIGENDIAN)
++ENDIF(BIGENDIAN)
++
+ # When the option has been selected to compile the test suite,
+ # compile an additional version of blosc_shared which exports
+ # some normally-hidden symbols (to facilitate unit testing).
diff -Nru c-blosc-1.11.1+ds1/debian/patches/series 
c-blosc-1.11.1+ds1/debian/patches/series
--- c-blosc-1.11.1+ds1/debian/patches/series    2016-09-04 12:56:02.000000000 
+0200
+++ c-blosc-1.11.1+ds1/debian/patches/series    2016-11-04 02:29:44.000000000 
+0100
@@ -1 +1,2 @@
 preserve-cflags-from-environment.patch
+bigendian.patch

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to