Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/zziplib/files: zziplib-0.13.50-sparc-aligned-access.patch
Date: Wed, 31 Dec 2008 22:40:04
Message-Id: E1LI9jO-0004Nh-LT@stork.gentoo.org
vapier      08/12/31 22:40:02

  Modified:             zziplib-0.13.50-sparc-aligned-access.patch
  Log:
  Update by Friedrich Oslage to use ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED.
  (Portage version: 2.2_rc20/cvs/Linux 2.6.28 x86_64)

Revision  Changes    Path
1.2                  dev-libs/zziplib/files/zziplib-0.13.50-sparc-aligned-access.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/zziplib/files/zziplib-0.13.50-sparc-aligned-access.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/zziplib/files/zziplib-0.13.50-sparc-aligned-access.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/zziplib/files/zziplib-0.13.50-sparc-aligned-access.patch?r1=1.1&r2=1.2

Index: zziplib-0.13.50-sparc-aligned-access.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-libs/zziplib/files/zziplib-0.13.50-sparc-aligned-access.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- zziplib-0.13.50-sparc-aligned-access.patch	27 Dec 2008 19:43:59 -0000	1.1
+++ zziplib-0.13.50-sparc-aligned-access.patch	31 Dec 2008 22:40:02 -0000	1.2
@@ -1,12 +1,13 @@
-XXX: should investigate ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
-
 This patch for zziplib (0.13.50) fixes a bus error on Linux/SPARC.
 
 Since SPARC machines are big endian and zip files are stored in little endian,
 zziplib needs to do byte swapping. On GNU/Linux this is usually done using
 glibc's bswap_{16,32,64} functions but in this case calling one of these
-functions triggers a bus error. This patch makes zziplib use it's own byte
-swapping functions (which do work) on Linux/SPARC instead of glibc's.
+functions triggers a bus error. This patch completes upstreams work to
+implement ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED for machines which required aligned
+access.
+After applying the patch zziplib needs to be compiled with
+-DZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
 
 To reproduce it run (in the src dir):
 	cd Linux_*_sparc64.d && ./bins/zzcat test/test/README
@@ -26,18 +27,7 @@
  
  #if defined ZZIP_WORDS_BIGENDIAN && \
 -   defined bswap_16 && defined bswap_32 && defined bswap_64
-+   defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(__sparc__)
++   defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED)
  # define __ZZIP_GET16(__p)                        bswap_16(*(uint16_t*)(__p))
  # define __ZZIP_GET32(__p)                        bswap_32(*(uint32_t*)(__p))
  # define __ZZIP_SET16(__p,__x) (*(uint16_t*)(__p) = bswap_16((uint16_t)(__x)))
---- zzip/fetch.h
-+++ zzip/fetch.h
-@@ -24,7 +24,7 @@ extern uint64_t __zzip_get64(zzip_byte_t * s) __zzip_attribute__((const));
- extern void     __zzip_set64(zzip_byte_t * s, uint64_t v);
- 
- #ifdef ZZIP_WORDS_BIGENDIAN
--# if defined bswap_16 && defined bswap_32 && defined bswap_64 /* i.e. linux */
-+# if defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(__sparc__) /* i.e. linux */
- # ifndef ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
- # define _ZZIP_USE_BSWAP
- # endif