summaryrefslogtreecommitdiff
path: root/editors/emacs20/patches/patch-bm
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2011-12-02 13:16:31 +0000
committertron <tron@pkgsrc.org>2011-12-02 13:16:31 +0000
commita52fbf78d44971ec4b525566c9386da041f66d5b (patch)
tree2d54c9ba99d1400c47d5b8bccaa39baaf96b208e /editors/emacs20/patches/patch-bm
parent8e72c11c62a109381b30e8f3868f022948db7777 (diff)
downloadpkgsrc-a52fbf78d44971ec4b525566c9386da041f66d5b.tar.gz
Pullup ticket #3617 - requested by dholland
editors/emacs20: bug fix patch Revisions pulled up: - editors/emacs20/distinfo 1.19-1.22 - editors/emacs20/patches/patch-ab 1.4 - editors/emacs20/patches/patch-bm 1.2-1.4 - editors/emacs20/patches/patch-cb deleted --- Module Name: pkgsrc Committed By: dholland Date: Thu Dec 1 04:05:41 UTC 2011 Modified Files: pkgsrc/editors/emacs20: distinfo pkgsrc/editors/emacs20/patches: patch-ab Log Message: Patch up configure tests for cpp to avoid problems when running gcc 4.5's cpp on makefiles. PR 45669. Unfortunately, this does not by itself fix the build; now I'm getting ./temacs -batch -l loadup dump gmake[1]: *** [emacs] Segmentation fault and I have a bad feeling that this may be the same issue that the other emacs versions are sometimes hitting. --- Module Name: pkgsrc Committed By: dholland Date: Thu Dec 1 04:51:30 UTC 2011 Modified Files: pkgsrc/editors/emacs20: distinfo pkgsrc/editors/emacs20/patches: patch-bm Removed Files: pkgsrc/editors/emacs20/patches: patch-cb Log Message: Fold patch-cb into patch-bm since they patch the same file. Related to PR 45669. hi joerg! --- Module Name: pkgsrc Committed By: dholland Date: Thu Dec 1 05:07:23 UTC 2011 Modified Files: pkgsrc/editors/emacs20: distinfo pkgsrc/editors/emacs20/patches: patch-bm Log Message: 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. --- Module Name: pkgsrc Committed By: dholland Date: Thu Dec 1 05:12:57 UTC 2011 Modified Files: pkgsrc/editors/emacs20: distinfo pkgsrc/editors/emacs20/patches: patch-bm Log Message: Extend previous to realloc and free as well, which is almost certainly necessary. PR 45669.
Diffstat (limited to 'editors/emacs20/patches/patch-bm')
-rw-r--r--editors/emacs20/patches/patch-bm46
1 files changed, 41 insertions, 5 deletions
diff --git a/editors/emacs20/patches/patch-bm b/editors/emacs20/patches/patch-bm
index cfb21861577..aacf072a95d 100644
--- a/editors/emacs20/patches/patch-bm
+++ b/editors/emacs20/patches/patch-bm
@@ -1,12 +1,18 @@
-$NetBSD: patch-bm,v 1.1.1.1 2003/04/11 00:31:45 uebayasi Exp $
+$NetBSD: patch-bm,v 1.1.1.1.68.1 2011/12/02 13:16:31 tron 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 @@
+- use standard headers
+- fix type of __malloc_extra_blocks
+- add an empty asm() destroying memory that prevents gcc from
+ optimizing out __malloc_hook and friends (which leads to
+ SIGSEGV in temacs during build)
+
+--- 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>
-+#include <malloc.h>
++#include <stdlib.h>
#define __malloc_size_t size_t
#else
#define __malloc_size_t unsigned int
@@ -17,3 +23,33 @@ $NetBSD: patch-bm,v 1.1.1.1 2003/04/11 00:31:45 uebayasi Exp $
#endif /* !defined(DOUG_LEA_MALLOC) */
#define max(A,B) ((A) > (B) ? (A) : (B))
+@@ -380,6 +381,9 @@ emacs_blocked_free (ptr)
+ {
+ BLOCK_INPUT;
+ __free_hook = old_free_hook;
++#ifdef __GNUC__
++ __asm __volatile("":::"memory");
++#endif
+ free (ptr);
+ /* If we released our reserve (due to running out of memory),
+ and we have a fair amount free once again,
+@@ -420,6 +424,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
+@@ -441,6 +448,9 @@ emacs_blocked_realloc (ptr, size)
+
+ BLOCK_INPUT;
+ __realloc_hook = old_realloc_hook;
++#ifdef __GNUC__
++ __asm __volatile("":::"memory");
++#endif
+ value = (void *) realloc (ptr, size);
+ __realloc_hook = emacs_blocked_realloc;
+ UNBLOCK_INPUT;