1 |
vapier 08/12/31 22:40:02 |
2 |
|
3 |
Modified: zziplib-0.13.50-sparc-aligned-access.patch |
4 |
Log: |
5 |
Update by Friedrich Oslage to use ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED. |
6 |
(Portage version: 2.2_rc20/cvs/Linux 2.6.28 x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 dev-libs/zziplib/files/zziplib-0.13.50-sparc-aligned-access.patch |
10 |
|
11 |
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 |
12 |
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 |
13 |
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 |
14 |
|
15 |
Index: zziplib-0.13.50-sparc-aligned-access.patch |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/dev-libs/zziplib/files/zziplib-0.13.50-sparc-aligned-access.patch,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- zziplib-0.13.50-sparc-aligned-access.patch 27 Dec 2008 19:43:59 -0000 1.1 |
22 |
+++ zziplib-0.13.50-sparc-aligned-access.patch 31 Dec 2008 22:40:02 -0000 1.2 |
23 |
@@ -1,12 +1,13 @@ |
24 |
-XXX: should investigate ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED |
25 |
- |
26 |
This patch for zziplib (0.13.50) fixes a bus error on Linux/SPARC. |
27 |
|
28 |
Since SPARC machines are big endian and zip files are stored in little endian, |
29 |
zziplib needs to do byte swapping. On GNU/Linux this is usually done using |
30 |
glibc's bswap_{16,32,64} functions but in this case calling one of these |
31 |
-functions triggers a bus error. This patch makes zziplib use it's own byte |
32 |
-swapping functions (which do work) on Linux/SPARC instead of glibc's. |
33 |
+functions triggers a bus error. This patch completes upstreams work to |
34 |
+implement ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED for machines which required aligned |
35 |
+access. |
36 |
+After applying the patch zziplib needs to be compiled with |
37 |
+-DZZIP_HAVE_ALIGNED_ACCESS_REQUIRED |
38 |
|
39 |
To reproduce it run (in the src dir): |
40 |
cd Linux_*_sparc64.d && ./bins/zzcat test/test/README |
41 |
@@ -26,18 +27,7 @@ |
42 |
|
43 |
#if defined ZZIP_WORDS_BIGENDIAN && \ |
44 |
- defined bswap_16 && defined bswap_32 && defined bswap_64 |
45 |
-+ defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(__sparc__) |
46 |
++ defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED) |
47 |
# define __ZZIP_GET16(__p) bswap_16(*(uint16_t*)(__p)) |
48 |
# define __ZZIP_GET32(__p) bswap_32(*(uint32_t*)(__p)) |
49 |
# define __ZZIP_SET16(__p,__x) (*(uint16_t*)(__p) = bswap_16((uint16_t)(__x))) |
50 |
---- zzip/fetch.h |
51 |
-+++ zzip/fetch.h |
52 |
-@@ -24,7 +24,7 @@ extern uint64_t __zzip_get64(zzip_byte_t * s) __zzip_attribute__((const)); |
53 |
- extern void __zzip_set64(zzip_byte_t * s, uint64_t v); |
54 |
- |
55 |
- #ifdef ZZIP_WORDS_BIGENDIAN |
56 |
--# if defined bswap_16 && defined bswap_32 && defined bswap_64 /* i.e. linux */ |
57 |
-+# if defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(__sparc__) /* i.e. linux */ |
58 |
- # ifndef ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED |
59 |
- # define _ZZIP_USE_BSWAP |
60 |
- # endif |