summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2011-12-31 11:40:27 +0000
committerdholland <dholland@pkgsrc.org>2011-12-31 11:40:27 +0000
commit5b8e4e1826179a9cefb1cad6a440d315d63979f5 (patch)
tree1c761237eefa0c9c6e2d45d78b6af93c3b8cf106 /editors
parent61f76ca14613eafe38f42e3eca0b286ef7ace728 (diff)
downloadpkgsrc-5b8e4e1826179a9cefb1cad6a440d315d63979f5.tar.gz
Merge patch-bm from emacs20 (prevent gcc from optimizing out __malloc_hook)
to fix one source of SIGSEGVs during build.
Diffstat (limited to 'editors')
-rw-r--r--editors/emacs21/Makefile.common5
-rw-r--r--editors/emacs21/distinfo3
-rw-r--r--editors/emacs21/patches/patch-src_alloc_c48
3 files changed, 54 insertions, 2 deletions
diff --git a/editors/emacs21/Makefile.common b/editors/emacs21/Makefile.common
index 670eda135d3..9368cdf6106 100644
--- a/editors/emacs21/Makefile.common
+++ b/editors/emacs21/Makefile.common
@@ -1,4 +1,7 @@
-# $NetBSD: Makefile.common,v 1.8 2011/03/21 06:05:44 obache Exp $
+# $NetBSD: Makefile.common,v 1.9 2011/12/31 11:40:27 dholland Exp $
+#
+# used by editors/emacs21/Makefile
+# used by editors/emacs21-nox11/Makefile
DISTNAME= emacs-${EMACSVERSION}a
diff --git a/editors/emacs21/distinfo b/editors/emacs21/distinfo
index ef067b96c30..d198dc4db74 100644
--- a/editors/emacs21/distinfo
+++ b/editors/emacs21/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.10 2011/01/24 09:42:40 wiz Exp $
+$NetBSD: distinfo,v 1.11 2011/12/31 11:40:27 dholland Exp $
SHA1 (emacs-21.4a.tar.gz) = cdb33731180fe4a912838af805dd35e3f55394d4
RMD160 (emacs-21.4a.tar.gz) = c312e739935b56d08783bbfe97992297a363cb8a
@@ -33,4 +33,5 @@ SHA1 (patch-ba) = ae05985ce8cabffdfbfb84905e1d6b0de7690b25
SHA1 (patch-bb) = bf748292c57459b1240da01f9d3df16e4dc40fa2
SHA1 (patch-bg) = 567ccce83e2b6d898a87f20763d5ff4b19c30deb
SHA1 (patch-cf) = 1b5b83eb02872414fd7ca29c344c0560feaf1b7e
+SHA1 (patch-src_alloc_c) = c9d2c7832b8b48835b81789f938540e3827f7cd8
SHA1 (patch-xx) = cf1cb21e0bd96202622ff54e39d202bdae78c942
diff --git a/editors/emacs21/patches/patch-src_alloc_c b/editors/emacs21/patches/patch-src_alloc_c
new file mode 100644
index 00000000000..3ad1ffe3eae
--- /dev/null
+++ b/editors/emacs21/patches/patch-src_alloc_c
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_alloc_c,v 1.1 2011/12/31 11:40:27 dholland Exp $
+
+- use standard headers
+- 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 2003-01-17 13:45:13.000000000 +0000
++++ src/alloc.c
+@@ -57,6 +57,8 @@ Boston, MA 02111-1307, USA. */
+ extern POINTER_TYPE *sbrk ();
+ #endif
+
++#include <stdlib.h>
++
+ #ifdef DOUG_LEA_MALLOC
+
+ #include <malloc.h>
+@@ -685,6 +687,9 @@ emacs_blocked_free (ptr)
+ #endif /* GC_MALLOC_CHECK */
+
+ __free_hook = old_free_hook;
++#ifdef __GNUC__
++ __asm __volatile("":::"memory");
++#endif
+ free (ptr);
+
+ /* If we released our reserve (due to running out of memory),
+@@ -728,6 +733,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
+@@ -776,6 +784,9 @@ emacs_blocked_realloc (ptr, size)
+
+ BLOCK_INPUT;
+ __realloc_hook = old_realloc_hook;
++#ifdef __GNUC__
++ __asm __volatile("":::"memory");
++#endif
+
+ #ifdef GC_MALLOC_CHECK
+ if (ptr)