ppc fix
authorLuca Barbato <lu_zero@gentoo.org>
Wed, 6 Oct 2004 22:40:16 +0000 (22:40 +0000)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 6 Oct 2004 22:40:16 +0000 (22:40 +0000)
app-text/ghostscript/ChangeLog
app-text/ghostscript/Manifest
app-text/ghostscript/files/gs-fix-gc.patch [new file with mode: 0644]
app-text/ghostscript/ghostscript-7.07.1-r6.ebuild

index 61dc85eff32db3eb099430ea389d05f78b317d2c..f1d97a576363d0dd4d4b968180122c5c543ee764 100644 (file)
@@ -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,
index f704cee4fe6ee747ca5eb89ace08f32678f8c0ed..ca1db077500917212fba745a8573edbf37e5242d 100644 (file)
@@ -1,29 +1,30 @@
-MD5 d4fd28cb93273f0c3ca650e4be56cc21 ChangeLog 12087
+MD5 0eb21cd33b7646ed6bab341f994c6640 ghostscript-7.05.6-r1.ebuild 2749
 MD5 e5f37353cc211a2f71cc8841bb8cc1ba ghostscript-7.07.1-r1.ebuild 3187
-MD5 26b4b081d538c195dc39bcb2ec8e6f3a metadata.xml 161
+MD5 8182f0d98162f7b51b03f8017d4035f8 ghostscript-7.07.1-r6.ebuild 3722
 MD5 2db7df35be7d9e0921a6ab5c72c02f67 ghostscript-7.07.1-r2.ebuild 3295
-MD5 4c43a0cacba1f4a15e9578ed603257fd ghostscript-7.05.6.ebuild 2739
+MD5 6a3949a845d79b6f29d62e2e91f27f94 ghostscript-7.07.1-r5.ebuild 3671
+MD5 5e56a962d78684b6a1d350de6755083a ChangeLog 12367
+MD5 26b4b081d538c195dc39bcb2ec8e6f3a metadata.xml 161
 MD5 0d1e785f83f28fcc649afaee1641be97 ghostscript-7.07.1-r3.ebuild 3443
+MD5 4c43a0cacba1f4a15e9578ed603257fd ghostscript-7.05.6.ebuild 2739
 MD5 d26ced8d0d60522b769bed4ebf49308a ghostscript-7.07.1-r4.ebuild 3644
-MD5 6a3949a845d79b6f29d62e2e91f27f94 ghostscript-7.07.1-r5.ebuild 3671
-MD5 0eb21cd33b7646ed6bab341f994c6640 ghostscript-7.05.6-r1.ebuild 2749
-MD5 05b1abed41f753d746ef7858f57378b0 ghostscript-7.07.1-r6.ebuild 3637
-MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r1 291
-MD5 68fa21d11a860c222c8ba89c39ce578e files/gs7.05.6-gdevpx.patch 402
-MD5 fd34b2b7a029f19eab4ba3f69afe295e files/ghostscript-7.05.6.man.patch 1231
-MD5 ac6af6bf67095500ea043aea27062d62 files/gs7.07.1-ijs.patch 401
-MD5 5f1b04ca58928a339b749703e067e2ba files/gs7.05.6-kochi-substitute.patch 3774
-MD5 7208aacbb4aa234ce1a6126e8f682c06 files/gs7.07.1-ps2epsi.patch 372
+MD5 4d11b45e0a5dd9ee77d7757d76814fd9 files/gs7.07.1-cjk.diff.bz2 3264
+MD5 6807c3b6025d5b09e8eb6349769162d1 files/digest-ghostscript-7.05.6-r1 212
 MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r2 291
+MD5 68fa21d11a860c222c8ba89c39ce578e files/gs7.05.6-gdevpx.patch 402
+MD5 8c6a3d7e8897b4297ef853dbd89e408b files/gs-fix-gc.patch 5627
+MD5 b7ca313a24a8adf4c527c0a097354f60 files/digest-ghostscript-7.07.1-r6 212
+MD5 291c8895063b8ecee12b68d45a705ab4 files/gs7.05-gdevhl12.c.bz2 7406
 MD5 acda8ddfde1efeaf451cb28a67dcc773 files/gs7.07.1-krgb.patch.gz 5569
-MD5 c63f6d71a403dbc72265831386b84eb0 files/digest-ghostscript-7.05.6 359
-MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r3 291
-MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r4 291
+MD5 3d1cdf07dabc4a05bde9a2dc6f7da2de files/gs7.07.1-fontconfig-rh.patch.bz2 6121
+MD5 7208aacbb4aa234ce1a6126e8f682c06 files/gs7.07.1-ps2epsi.patch 372
+MD5 5f1b04ca58928a339b749703e067e2ba files/gs7.05.6-kochi-substitute.patch 3774
+MD5 fd34b2b7a029f19eab4ba3f69afe295e files/ghostscript-7.05.6.man.patch 1231
 MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r5 291
-MD5 291c8895063b8ecee12b68d45a705ab4 files/gs7.05-gdevhl12.c.bz2 7406
+MD5 ac6af6bf67095500ea043aea27062d62 files/gs7.07.1-ijs.patch 401
+MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r1 291
 MD5 343b6a60e15e35d0c5f825b4f361fd29 files/gs7.05.6-cjk.diff.bz2 3287
-MD5 3d1cdf07dabc4a05bde9a2dc6f7da2de files/gs7.07.1-fontconfig-rh.patch.bz2 6121
-MD5 4d11b45e0a5dd9ee77d7757d76814fd9 files/gs7.07.1-cjk.diff.bz2 3264
 MD5 370d4bcd16d8acd03190ba84e2f61a41 files/gs7.07.1-ijsdestdir.patch 1418
-MD5 6807c3b6025d5b09e8eb6349769162d1 files/digest-ghostscript-7.05.6-r1 212
-MD5 b7ca313a24a8adf4c527c0a097354f60 files/digest-ghostscript-7.07.1-r6 212
+MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r3 291
+MD5 71a93bd09748f37be38b726b0530e497 files/digest-ghostscript-7.07.1-r4 291
+MD5 c63f6d71a403dbc72265831386b84eb0 files/digest-ghostscript-7.05.6 359
diff --git a/app-text/ghostscript/files/gs-fix-gc.patch b/app-text/ghostscript/files/gs-fix-gc.patch
new file mode 100644 (file)
index 0000000..953b21a
--- /dev/null
@@ -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. */
index 672b32f3ca0172ee785b0c801dec655c0349c26c..ab732a91d5c41190825e3d84aaae84eaca8e67b1 100644 (file)
@@ -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):"\