Adding patch to fix segfault if -fomit-frame-pointer is in CFLAGS (bug #104265)
authorLeonardo Boshell <leonardop@gentoo.org>
Wed, 31 Aug 2005 07:57:02 +0000 (07:57 +0000)
committerLeonardo Boshell <leonardop@gentoo.org>
Wed, 31 Aug 2005 07:57:02 +0000 (07:57 +0000)
Package-Manager: portage-2.0.51.22-r2

x11-libs/cairo/ChangeLog
x11-libs/cairo/Manifest
x11-libs/cairo/cairo-1.0.0-r1.ebuild [moved from x11-libs/cairo/cairo-1.0.0.ebuild with 68% similarity]
x11-libs/cairo/files/cairo-1.0.0-omit_frame_pointer_fix.patch [new file with mode: 0644]
x11-libs/cairo/files/digest-cairo-1.0.0-r1 [moved from x11-libs/cairo/files/digest-cairo-1.0.0 with 100% similarity]

index 26db21d81fcab494d9827653ababeb331146bfd1..1f62e96325d81992df0fff60018d872a574a6579 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for x11-libs/cairo
 # Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/ChangeLog,v 1.43 2005/08/25 10:42:04 leonardop Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/ChangeLog,v 1.44 2005/08/31 07:57:02 leonardop Exp $
+
+*cairo-1.0.0-r1 (31 Aug 2005)
+
+  31 Aug 2005; Leonardo Boshell <leonardop@gentoo.org>
+  +files/cairo-1.0.0-omit_frame_pointer_fix.patch, -cairo-1.0.0.ebuild,
+  +cairo-1.0.0-r1.ebuild:
+  Added patch from upstream CVS repository that fixes a segmentation fault
+  when -fomit-frame-pointer is in CFLAGS (bug #104265).
 
 *cairo-1.0.0 (25 Aug 2005)
 
index 46af56dc595707d0d7b622f01c2001772f89a4c1..8c581fcf24093e08565ce9e264812bf0a604bdb4 100644 (file)
@@ -1,13 +1,14 @@
-MD5 85228b97683578173b5f41858c2abfce ChangeLog 6191
+MD5 809a14c91d998b328a0233b78e2cb06c ChangeLog 6507
+MD5 774122d09bbd9129ec9c080c87023dcd cairo-1.0.0-r1.ebuild 1527
 MD5 3a4cce771cdc4714c6931467622c9ddc cairo-0.1.23-r1.ebuild 757
-MD5 3009d8a342e6477894738ab982283340 cairo-1.0.0.ebuild 1298
 MD5 4db2c222787dd6470523acdfe996891e cairo-0.2.0-r1.ebuild 900
 MD5 627da87d1d67830749f3dafde81804ca cairo-0.3.0.ebuild 843
 MD5 ea284a6e24864155e0176859cbddf1b3 metadata.xml 335
 MD5 c307699f3bb9e8e6f81b2aba114c1ea2 cairo-0.3.0-r2.ebuild 998
 MD5 1d2ad415e2e6db1a58640bb93b15a34f cairo-0.4.0.ebuild 994
+MD5 2d06b8355150f68fc54350a976a5e668 files/digest-cairo-1.0.0-r1 64
+MD5 b5edc8c1ed78cd07fdeef82c1933b436 files/cairo-1.0.0-omit_frame_pointer_fix.patch 2064
 MD5 8045b9ac7481eb952f3c2fdfda944c65 files/digest-cairo-0.1.23-r1 64
-MD5 2d06b8355150f68fc54350a976a5e668 files/digest-cairo-1.0.0 64
 MD5 ee0e0ddbf61c280106ae3683503054a8 files/digest-cairo-0.2.0-r1 63
 MD5 2a0e4de10c4b8aacdb9b5991825b30d5 files/digest-cairo-0.3.0 63
 MD5 4df3bcd9171f83ca24b03ab0f8eefb24 files/cairo-0.3.0-header-fix.diff 697
similarity index 68%
rename from x11-libs/cairo/cairo-1.0.0.ebuild
rename to x11-libs/cairo/cairo-1.0.0-r1.ebuild
index f265c85e0314666e0f41d1810fc7bce0dee69e15..41b3c5d32ca8ec5ca2f0fbe48b5c3b43ca82b21d 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/cairo-1.0.0.ebuild,v 1.1 2005/08/25 10:42:04 leonardop Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/cairo-1.0.0-r1.ebuild,v 1.1 2005/08/31 07:57:02 leonardop Exp $
 
 inherit eutils
 
@@ -33,9 +33,22 @@ DEPEND="${RDEPEND}
                ~app-text/docbook-xml-dtd-4.2 )"
 
 
+src_unpack() {
+       unpack "${A}"
+       cd "${S}"
+
+       # Fix segmentation fault when compiling with -fomit-frame-pointer.
+       # See bug #104265.
+       epatch ${FILESDIR}/${P}-omit_frame_pointer_fix.patch
+}
+
 src_compile() {
-       local myconf="$(use_enable X xlib) $(use_with X x) $(use_enable png) \
-               $(use_enable static) $(use_enable doc gtk-doc) $(use_enable glitz)"
+       local myconf="$(use_enable X xlib) \
+               $(use_with X x)           \
+               $(use_enable png)         \
+               $(use_enable static)      \
+               $(use_enable doc gtk-doc) \
+               $(use_enable glitz)"
 
        econf $myconf || die "./configure failed"
        emake || die "Compilation failed"
diff --git a/x11-libs/cairo/files/cairo-1.0.0-omit_frame_pointer_fix.patch b/x11-libs/cairo/files/cairo-1.0.0-omit_frame_pointer_fix.patch
new file mode 100644 (file)
index 0000000..8b30a96
--- /dev/null
@@ -0,0 +1,58 @@
+diff -NurdB cairo-1.0.0/pixman/src/fbmmx.c cairo-1.0.0-patched/pixman/src/fbmmx.c
+--- cairo-1.0.0/pixman/src/fbmmx.c     2005-08-18 23:40:01.000000000 -0500
++++ cairo-1.0.0-patched/pixman/src/fbmmx.c     2005-08-30 10:39:33.000000000 -0500
+@@ -2488,28 +2488,38 @@
+     vendor[0] = 0;
+     vendor[12] = 0;
+     /* see p. 118 of amd64 instruction set manual Vol3 */
+-    __asm__ ("push %%ebx\n"
+-             "pushf\n"
++    /* We need to be careful about the handling of %ebx and
++     * %esp here. We can't declare either one as clobbered
++     * since they are special registers (%ebx is the "PIC
++     * register" holding an offset to global data, %esp the
++     * stack pointer), so we need to make sure they have their
++     * original values when we access the output operands.
++     */
++    __asm__ ("pushf\n"
+              "pop %%eax\n"
+-             "mov %%eax, %%ebx\n"
++             "mov %%eax, %%ecx\n"
+              "xor $0x00200000, %%eax\n"
+              "push %%eax\n"
+              "popf\n"
+              "pushf\n"
+              "pop %%eax\n"
+              "mov $0x0, %%edx\n"
+-             "xor %%ebx, %%eax\n"
++             "xor %%ecx, %%eax\n"
+              "jz skip\n"
+ 
+              "mov $0x00000000, %%eax\n"
++           "push %%ebx\n"
+              "cpuid\n"
+-             "mov %%ebx, %1\n"
++             "mov %%ebx, %%eax\n"
++           "pop %%ebx\n"
++             "mov %%eax, %1\n"
+              "mov %%edx, %2\n"
+              "mov %%ecx, %3\n"
+              "mov $0x00000001, %%eax\n"
++           "push %%ebx\n"
+              "cpuid\n"
++           "pop %%ebx\n"
+              "skip:\n"
+-             "pop %%ebx\n"
+              "mov %%edx, %0\n"
+              : "=r" (result), 
+                "=m" (vendor[0]), 
+@@ -2543,8 +2553,8 @@
+                     "mov $0x80000001, %%eax\n"
+                     "cpuid\n"
+                     "skip2:\n"
+-                    "mov %%edx, %0\n"
+                     "pop %%ebx\n"
++                    "mov %%edx, %0\n"
+                     : "=r" (result)
+                     :
+                     : "%eax", "%ecx", "%edx"