pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/editors/emacs21 Merge patch-bm from emacs20 (prevent g...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1b4c3cd2ffec
branches:  trunk
changeset: 597544:1b4c3cd2ffec
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sat Dec 31 11:40:27 2011 +0000

description:
Merge patch-bm from emacs20 (prevent gcc from optimizing out __malloc_hook)
to fix one source of SIGSEGVs during build.

diffstat:

 editors/emacs21/Makefile.common           |   5 ++-
 editors/emacs21/distinfo                  |   3 +-
 editors/emacs21/patches/patch-src_alloc_c |  48 +++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 2 deletions(-)

diffs (79 lines):

diff -r 55fc12c0fd7b -r 1b4c3cd2ffec editors/emacs21/Makefile.common
--- a/editors/emacs21/Makefile.common   Sat Dec 31 11:16:30 2011 +0000
+++ b/editors/emacs21/Makefile.common   Sat Dec 31 11:40:27 2011 +0000
@@ -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 -r 55fc12c0fd7b -r 1b4c3cd2ffec editors/emacs21/distinfo
--- a/editors/emacs21/distinfo  Sat Dec 31 11:16:30 2011 +0000
+++ b/editors/emacs21/distinfo  Sat Dec 31 11:40:27 2011 +0000
@@ -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-bb) = bf748292c57459b1240da01f9d3df16e4dc40fa2
 SHA1 (patch-bg) = 567ccce83e2b6d898a87f20763d5ff4b19c30deb
 SHA1 (patch-cf) = 1b5b83eb02872414fd7ca29c344c0560feaf1b7e
+SHA1 (patch-src_alloc_c) = c9d2c7832b8b48835b81789f938540e3827f7cd8
 SHA1 (patch-xx) = cf1cb21e0bd96202622ff54e39d202bdae78c942
diff -r 55fc12c0fd7b -r 1b4c3cd2ffec editors/emacs21/patches/patch-src_alloc_c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/editors/emacs21/patches/patch-src_alloc_c Sat Dec 31 11:40:27 2011 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index