Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 239472 | Differences between
and this patch

Collapse All | Expand All

(-)zziplib-0.13.50.ebuild (-1 / +2 lines)
Lines 2-8 Link Here
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/dev-libs/zziplib/zziplib-0.13.50.ebuild,v 1.1 2008/12/27 19:44:00 vapier Exp $
3
# $Header: /var/cvsroot/gentoo-x86/dev-libs/zziplib/zziplib-0.13.50.ebuild,v 1.1 2008/12/27 19:44:00 vapier Exp $
4
4
5
inherit libtool fixheadtails eutils
5
inherit libtool fixheadtails eutils flag-o-matic
6
6
7
DESCRIPTION="Lightweight library used to easily extract data from files archived in a single zip file"
7
DESCRIPTION="Lightweight library used to easily extract data from files archived in a single zip file"
8
HOMEPAGE="http://zziplib.sourceforge.net/"
8
HOMEPAGE="http://zziplib.sourceforge.net/"
Lines 35-40 Link Here
35
}
35
}
36
36
37
src_compile() {
37
src_compile() {
38
	use sparc && append-flags -DZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
38
	econf $(use_enable sdl) || die
39
	econf $(use_enable sdl) || die
39
	emake || die "emake failed"
40
	emake || die "emake failed"
40
}
41
}
(-)files/zziplib-0.13.50-sparc-aligned-access.patch (-16 / +6 lines)
Lines 1-12 Link Here
1
XXX: should investigate ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
2
3
This patch for zziplib (0.13.50) fixes a bus error on Linux/SPARC.
1
This patch for zziplib (0.13.50) fixes a bus error on Linux/SPARC.
4
2
5
Since SPARC machines are big endian and zip files are stored in little endian,
3
Since SPARC machines are big endian and zip files are stored in little endian,
6
zziplib needs to do byte swapping. On GNU/Linux this is usually done using
4
zziplib needs to do byte swapping. On GNU/Linux this is usually done using
7
glibc's bswap_{16,32,64} functions but in this case calling one of these
5
glibc's bswap_{16,32,64} functions but in this case calling one of these
8
functions triggers a bus error. This patch makes zziplib use it's own byte
6
functions triggers a bus error. This patch completes upstreams work to
9
swapping functions (which do work) on Linux/SPARC instead of glibc's.
7
implement ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED for machines which required aligned
8
access.
9
After applying the patch zziplib needs to be compiled with
10
-DZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
10
11
11
To reproduce it run (in the src dir):
12
To reproduce it run (in the src dir):
12
	cd Linux_*_sparc64.d && ./bins/zzcat test/test/README
13
	cd Linux_*_sparc64.d && ./bins/zzcat test/test/README
Lines 26-43 Link Here
26
 
27
 
27
 #if defined ZZIP_WORDS_BIGENDIAN && \
28
 #if defined ZZIP_WORDS_BIGENDIAN && \
28
-   defined bswap_16 && defined bswap_32 && defined bswap_64
29
-   defined bswap_16 && defined bswap_32 && defined bswap_64
29
+   defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(__sparc__)
30
+   defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED)
30
 # define __ZZIP_GET16(__p)                        bswap_16(*(uint16_t*)(__p))
31
 # define __ZZIP_GET16(__p)                        bswap_16(*(uint16_t*)(__p))
31
 # define __ZZIP_GET32(__p)                        bswap_32(*(uint32_t*)(__p))
32
 # define __ZZIP_GET32(__p)                        bswap_32(*(uint32_t*)(__p))
32
 # define __ZZIP_SET16(__p,__x) (*(uint16_t*)(__p) = bswap_16((uint16_t)(__x)))
33
 # define __ZZIP_SET16(__p,__x) (*(uint16_t*)(__p) = bswap_16((uint16_t)(__x)))
33
--- zzip/fetch.h
34
+++ zzip/fetch.h
35
@@ -24,7 +24,7 @@ extern uint64_t __zzip_get64(zzip_byte_t * s) __zzip_attribute__((const));
36
 extern void     __zzip_set64(zzip_byte_t * s, uint64_t v);
37
 
38
 #ifdef ZZIP_WORDS_BIGENDIAN
39
-# if defined bswap_16 && defined bswap_32 && defined bswap_64 /* i.e. linux */
40
+# if defined bswap_16 && defined bswap_32 && defined bswap_64 && !defined(__sparc__) /* i.e. linux */
41
 # ifndef ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED
42
 # define _ZZIP_USE_BSWAP
43
 # endif

Return to bug 239472