summaryrefslogtreecommitdiff
path: root/editors/emacs20
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2011-12-01 05:07:22 +0000
committerdholland <dholland@pkgsrc.org>2011-12-01 05:07:22 +0000
commit851a85ee41bd732dcf45e01c7709dc1eab4b3afe (patch)
tree904053e58fcf75a366e66f6284ca12d954601aa1 /editors/emacs20
parent31c01d265d1420534fc4bdf8906bb93c06a39746 (diff)
downloadpkgsrc-851a85ee41bd732dcf45e01c7709dc1eab4b3afe.tar.gz
Add __asm __volatile("":::"memory") at a critical point in alloc.c.
gcc thinks it knows the semantics of malloc and so it thinks it can optimize out the manipulation of __malloc_hook; however, doing so causes the subsequent malloc call to come back to itself, leading to an infinite recursion and SIGSEGV in temacs. This fixes the remaining part of PR 45669. Someone(TM) should check if this issue affects other Emacs versions and/or XEmacs.
Diffstat (limited to 'editors/emacs20')
-rw-r--r--editors/emacs20/distinfo4
-rw-r--r--editors/emacs20/patches/patch-bm18
2 files changed, 16 insertions, 6 deletions
diff --git a/editors/emacs20/distinfo b/editors/emacs20/distinfo
index 1acf38b6214..fd072782a73 100644
--- a/editors/emacs20/distinfo
+++ b/editors/emacs20/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.20 2011/12/01 04:51:30 dholland Exp $
+$NetBSD: distinfo,v 1.21 2011/12/01 05:07:22 dholland Exp $
SHA1 (emacs-20.7-mule-4.1b-elc.tar.gz) = 3894fb2b81bb326545f6ccc3bf0a8405c23004ff
RMD160 (emacs-20.7-mule-4.1b-elc.tar.gz) = c675b31dafaa4321a453af9d87eddf051ee71b1f
@@ -47,7 +47,7 @@ SHA1 (patch-bi) = d97512603b313ee730687e3b5680d45002ade51c
SHA1 (patch-bj) = 6dba88723ee632b67fcf6a2dd2918e69034837e2
SHA1 (patch-bk) = 7582e915a5bd9778259961e7fa842d5cdce3e85c
SHA1 (patch-bl) = f2cd03713d7cdb6cb41119569031249d7d708b13
-SHA1 (patch-bm) = 792c692e23bfcbd154214152f90511e3e750b56d
+SHA1 (patch-bm) = b493e6d24bc3940da004322651ee24a25eda46e5
SHA1 (patch-bn) = 247c04ae1accf3bc6b07b22767eb3cf2cdb55013
SHA1 (patch-bo) = f9b8b73af91a445dbf50f9e862b84c7abc2b730e
SHA1 (patch-bp) = 9091134cf50e17ce58976c3193666e716345a124
diff --git a/editors/emacs20/patches/patch-bm b/editors/emacs20/patches/patch-bm
index 313682470e4..ea6a0be585e 100644
--- a/editors/emacs20/patches/patch-bm
+++ b/editors/emacs20/patches/patch-bm
@@ -1,8 +1,8 @@
-$NetBSD: patch-bm,v 1.2 2011/12/01 04:51:30 dholland Exp $
+$NetBSD: patch-bm,v 1.3 2011/12/01 05:07:23 dholland Exp $
---- ./src/alloc.c.orig Thu Sep 16 00:20:15 1999
-+++ ./src/alloc.c Tue Sep 26 11:54:24 2000
-@@ -53,12 +53,13 @@
+--- src/alloc.c.orig 1999-09-16 07:20:15.000000000 +0000
++++ src/alloc.c
+@@ -53,12 +53,13 @@ extern char *sbrk ();
#if defined (__STDC__) && __STDC__
#include <stddef.h>
@@ -17,3 +17,13 @@ $NetBSD: patch-bm,v 1.2 2011/12/01 04:51:30 dholland Exp $
#endif /* !defined(DOUG_LEA_MALLOC) */
#define max(A,B) ((A) > (B) ? (A) : (B))
+@@ -420,6 +421,9 @@ emacs_blocked_malloc (size)
+
+ BLOCK_INPUT;
+ __malloc_hook = old_malloc_hook;
++#ifdef __GNUC__
++ __asm __volatile("":::"memory");
++#endif
+ #ifdef DOUG_LEA_MALLOC
+ mallopt (M_TOP_PAD, malloc_hysteresis * 4096);
+ #else