diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2004-10-06 22:40:16 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2004-10-06 22:40:16 +0000 |
commit | 73549653229b6a72e120f5a706f43ecc1a0c73c3 (patch) | |
tree | b65d1fde98c512a835ba397ecfa8c217f587c0a9 /app-text/ghostscript | |
parent | use kernel-mod eclass for module checking #55080 (Manifest recommit) (diff) | |
download | gentoo-2-73549653229b6a72e120f5a706f43ecc1a0c73c3.tar.gz gentoo-2-73549653229b6a72e120f5a706f43ecc1a0c73c3.tar.bz2 gentoo-2-73549653229b6a72e120f5a706f43ecc1a0c73c3.zip |
ppc fix
Diffstat (limited to 'app-text/ghostscript')
-rw-r--r-- | app-text/ghostscript/ChangeLog | 8 | ||||
-rw-r--r-- | app-text/ghostscript/files/gs-fix-gc.patch | 145 | ||||
-rw-r--r-- | app-text/ghostscript/ghostscript-7.07.1-r6.ebuild | 7 |
3 files changed, 157 insertions, 3 deletions
diff --git a/app-text/ghostscript/ChangeLog b/app-text/ghostscript/ChangeLog index 61dc85eff32d..f1d97a576363 100644 --- a/app-text/ghostscript/ChangeLog +++ b/app-text/ghostscript/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-text/ghostscript # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript/ChangeLog,v 1.73 2004/10/05 06:43:50 usata Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript/ChangeLog,v 1.74 2004/10/06 22:40:16 lu_zero Exp $ + + 07 Oct 2004; Luca Barbato <lu_zero@gentoo.org> +files/gs-fix-gc.patch, + ghostscript-7.07.1-r6.ebuild: + Eventually found a fix for the garbage collector in the ghostscript ml, + thanks to Alex Cherepanov <alexcher@coscript.com> for the patch and pointing + out the solution 05 Oct 2004; Mamoru KOMACHI <usata@gentoo.org> +files/gs7.07.1-cjk.diff.bz2, ghostscript-7.05.6-r1.ebuild, diff --git a/app-text/ghostscript/files/gs-fix-gc.patch b/app-text/ghostscript/files/gs-fix-gc.patch new file mode 100644 index 000000000000..953b21a86fa1 --- /dev/null +++ b/app-text/ghostscript/files/gs-fix-gc.patch @@ -0,0 +1,145 @@ +Index: gs/src/gxalloc.h +=================================================================== +RCS file: /cvs/ghostscript/gs/src/gxalloc.h,v +retrieving revision 1.11 +diff -b -u -r1.11 gxalloc.h +--- gs/src/gxalloc.h 4 Aug 2004 19:36:12 -0000 1.11 ++++ gs/src/gxalloc.h 14 Sep 2004 21:44:37 -0000 +@@ -143,7 +143,7 @@ + byte *cbot; /* bottom of free area */ + /* (top of aligned objects) */ + obj_header_t *rcur; /* current refs object, 0 if none */ +- byte *rtop; /* top of rcur */ ++ byte *rtop; /* top of rcur, not aligned to obj_align_mod */ + byte *ctop; /* top of free area */ + /* (bottom of strings) */ + byte *climit; /* top of strings */ +Index: gs/src/gxobj.h +=================================================================== +RCS file: /cvs/ghostscript/gs/src/gxobj.h,v +retrieving revision 1.6 +diff -b -u -r1.6 gxobj.h +--- gs/src/gxobj.h 21 Feb 2002 22:24:53 -0000 1.6 ++++ gs/src/gxobj.h 14 Sep 2004 21:44:37 -0000 +@@ -110,20 +110,22 @@ + /* The only possible values for obj_align_mod are 4, 8, or 16.... */ + #if obj_align_mod == 4 + # define log2_obj_align_mod 2 +-#else +-#if obj_align_mod == 8 ++#elif obj_align_mod == 8 + # define log2_obj_align_mod 3 +-#else +-#if obj_align_mod == 16 ++#elif obj_align_mod == 16 + # define log2_obj_align_mod 4 +-#endif +-#endif ++#elif obj_align_mod == 32 /* for testing, not seen yet in the wild */ ++# define log2_obj_align_mod 5 ++#else ++# error Unexpected value of obj_align_mod + #endif + #define obj_align_mask (obj_align_mod-1) + #define obj_align_round(siz)\ + (uint)(((siz) + obj_align_mask) & -obj_align_mod) + #define obj_size_round(siz)\ + obj_align_round((siz) + sizeof(obj_header_t)) ++#define ptr_align_round(p)\ ++ ((byte *)obj_align_round((size_t)(p))) + + /* Define the real object header type, taking alignment into account. */ + struct obj_header_s { /* must be a struct because of forward reference */ +Index: gs/src/ialloc.c +=================================================================== +RCS file: /cvs/ghostscript/gs/src/ialloc.c,v +retrieving revision 1.7 +diff -b -u -r1.7 ialloc.c +--- gs/src/ialloc.c 4 Aug 2004 19:36:12 -0000 1.7 ++++ gs/src/ialloc.c 14 Sep 2004 21:44:37 -0000 +@@ -157,8 +157,8 @@ + + /* If we're allocating a run of refs already, */ + /* and we aren't about to overflow the maximum run length, use it. */ +- if (mem->cc.rtop == mem->cc.cbot && +- num_refs < (mem->cc.ctop - mem->cc.cbot) / sizeof(ref) && ++ if (ptr_align_round(mem->cc.rtop) == mem->cc.cbot && ++ num_refs < (mem->cc.ctop - mem->cc.rtop) / sizeof(ref) && + mem->cc.rtop - (byte *) mem->cc.rcur + num_refs * sizeof(ref) < + max_size_st_refs + ) { +@@ -169,8 +169,8 @@ + ialloc_trace_space(mem), client_name_string(cname), + num_refs, (ulong) obj); + mem->cc.rcur[-1].o_size += num_refs * sizeof(ref); +- end = (ref *) (mem->cc.rtop = mem->cc.cbot += +- num_refs * sizeof(ref)); ++ end = (ref *) (mem->cc.rtop += num_refs * sizeof(ref)); ++ mem->cc.cbot = ptr_align_round(mem->cc.rtop); + make_mark(end - 1); + } else { + /* +@@ -225,12 +225,12 @@ + return_error(e_Fatal); + diff = old_num_refs - new_num_refs; + /* Check for LIFO. See gs_free_ref_array for more details. */ +- if (mem->cc.rtop == mem->cc.cbot && ++ if (ptr_align_round(mem->cc.rtop) == mem->cc.cbot && + (byte *) (obj + (old_num_refs + 1)) == mem->cc.rtop + ) { + /* Shorten the refs object. */ +- ref *end = (ref *) (mem->cc.cbot = mem->cc.rtop -= +- diff * sizeof(ref)); ++ ref *end = (ref *) (mem->cc.rtop -= diff * sizeof(ref)); ++ mem->cc.cbot = ptr_align_round(mem->cc.rtop); + + if_debug4('A', "[a%d:<$ ]%s(%u) 0x%lx\n", + ialloc_trace_space(mem), client_name_string(cname), diff, +@@ -264,7 +264,7 @@ + */ + if (!r_has_type(parr, t_array)) + DO_NOTHING; /* don't look for special cases */ +- else if (mem->cc.rtop == mem->cc.cbot && ++ else if (ptr_align_round(mem->cc.rtop) == mem->cc.cbot && + (byte *) (obj + (num_refs + 1)) == mem->cc.rtop + ) { + if ((obj_header_t *) obj == mem->cc.rcur) { +@@ -278,7 +278,8 @@ + ialloc_trace_space(mem), client_name_string(cname), + num_refs, (ulong) obj); + mem->cc.rcur[-1].o_size -= num_refs * sizeof(ref); +- mem->cc.rtop = mem->cc.cbot = (byte *) (obj + 1); ++ mem->cc.rtop = (byte *) (obj + 1); ++ mem->cc.cbot = ptr_align_round(mem->cc.rtop); + make_mark(obj); + } + return; +Index: gs/src/igcref.c +=================================================================== +RCS file: /cvs/ghostscript/gs/src/igcref.c,v +retrieving revision 1.6 +diff -b -u -r1.6 igcref.c +--- gs/src/igcref.c 4 Aug 2004 19:36:12 -0000 1.6 ++++ gs/src/igcref.c 14 Sep 2004 21:44:37 -0000 +@@ -720,15 +720,18 @@ + new_size += sizeof(ref_packed); + /* We want to make the newly freed space into a free block, */ + /* but we can only do this if we have enough room. */ +- if (size - new_size < sizeof(obj_header_t)) { /* Not enough room. Pad to original size. */ ++ if (size < obj_align_round(new_size) + sizeof(obj_header_t)) { /* Not enough room. Pad to original size. */ + while (new_size < size) + *dest++ = pt_tag(pt_integer), + new_size += sizeof(ref_packed); + } else { +- obj_header_t *pfree = (obj_header_t *) ((ref *) dest + 1); ++ byte *pfree_u = (byte *)dest + sizeof(ref); ++ byte *pfree_a = ptr_align_round(pfree_u); ++ obj_header_t *pfree = (obj_header_t *)pfree_a; ++ int align = pfree_a - pfree_u; + + pfree->o_alone = 0; +- pfree->o_size = size - new_size - sizeof(obj_header_t); ++ pfree->o_size = size - new_size - sizeof(obj_header_t) - align; + pfree->o_type = &st_bytes; + } + /* Re-create the final ref. */ diff --git a/app-text/ghostscript/ghostscript-7.07.1-r6.ebuild b/app-text/ghostscript/ghostscript-7.07.1-r6.ebuild index 672b32f3ca01..ab732a91d5c4 100644 --- a/app-text/ghostscript/ghostscript-7.07.1-r6.ebuild +++ b/app-text/ghostscript/ghostscript-7.07.1-r6.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript/ghostscript-7.07.1-r6.ebuild,v 1.3 2004/10/05 06:43:50 usata Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript/ghostscript-7.07.1-r6.ebuild,v 1.4 2004/10/06 22:40:16 lu_zero Exp $ inherit flag-o-matic eutils gcc @@ -12,7 +12,7 @@ SRC_URI="mirror://sourceforge/espgs/espgs-${PV}-source.tar.bz2 LICENSE="GPL-2 LGPL-2" SLOT="0" -KEYWORDS="~ia64 ~x86 -ppc ~sparc ~alpha ~hppa ~amd64 ~mips ~ppc64" +KEYWORDS="~ia64 ~x86 ~ppc ~sparc ~alpha ~hppa ~amd64 ~mips ~ppc64" IUSE="X cups cjk emacs truetype" RDEPEND="virtual/libc @@ -63,6 +63,9 @@ src_unpack() { # Makefile.in fixes for DESTDIR support in libijs because # einstall borks on multilib systems -- eradicator epatch ${FILESDIR}/gs${PV}-ijsdestdir.patch + + # Fix the garbage collector on ia64 and ppc + epatch ${FILESDIR}/gs-fix-gc.patch # search path fix sed -i -e "s:\$\(gsdatadir\)/lib:/usr/share/ghostscript/7.07/$(get_libdir):"\ |