diff options
author | skrll <skrll@pkgsrc.org> | 2012-01-09 06:30:20 +0000 |
---|---|---|
committer | skrll <skrll@pkgsrc.org> | 2012-01-09 06:30:20 +0000 |
commit | c42a231e5f1207f4ea6ce3db5ad08a773c8b02c1 (patch) | |
tree | 7e81c61e1c7a0c043c6e607e687d7c560e0ba568 /editors | |
parent | 678100efadc979640f01c0ec3771b386ce59be3c (diff) | |
download | pkgsrc-c42a231e5f1207f4ea6ce3db5ad08a773c8b02c1.tar.gz |
Merge patch from other emacs packages - prevent from optimizing out
__malloc_hook) to fix one source of SIGSEGVs during build.
PR/45405 PR/35235
Diffstat (limited to 'editors')
-rw-r--r-- | editors/emacs22/distinfo | 3 | ||||
-rw-r--r-- | editors/emacs22/patches/patch-src_alloc_c | 48 |
2 files changed, 50 insertions, 1 deletions
diff --git a/editors/emacs22/distinfo b/editors/emacs22/distinfo index a0172ac9548..8eaaa557631 100644 --- a/editors/emacs22/distinfo +++ b/editors/emacs22/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.11 2011/09/24 00:54:52 ryoon Exp $ +$NetBSD: distinfo,v 1.12 2012/01/09 06:30:20 skrll Exp $ SHA1 (emacs-22.3.tar.gz) = 5e9b3e0205099a83be7198fd43ba1c9442a3feb0 RMD160 (emacs-22.3.tar.gz) = a7eed5099d0cab25f34152f1b18b5c1b4e2e0746 @@ -24,4 +24,5 @@ SHA1 (patch-av) = f2fcb0ccbddba1683cc7f1744bca8b171f83c0e7 SHA1 (patch-aw) = 575ffdbf0cf9554dee32aa88fd5a5f49c5ab2bf1 SHA1 (patch-ax) = 4a9a795fd08eedcd83c1c92ede566fd63f365bec SHA1 (patch-ba) = 066f6e0f1f69e1e477820589d9b9de4a4a168148 +SHA1 (patch-src_alloc_c) = 72055017f43d1526a90fdb3a02b6c317f488399d SHA1 (patch-xx) = 3b66bbad50cef9d248a6f1d49b9d31150e14d6e1 diff --git a/editors/emacs22/patches/patch-src_alloc_c b/editors/emacs22/patches/patch-src_alloc_c new file mode 100644 index 00000000000..90cb9fa8aad --- /dev/null +++ b/editors/emacs22/patches/patch-src_alloc_c @@ -0,0 +1,48 @@ +$NetBSD: patch-src_alloc_c,v 1.1 2012/01/09 06:30:20 skrll 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 2008-08-12 18:35:44.000000000 +0000 ++++ src/alloc.c 2012-01-05 08:36:58.000000000 +0000 +@@ -84,6 +84,8 @@ + #include "w32.h" + #endif + ++#include <stdlib.h> ++ + #ifdef DOUG_LEA_MALLOC + + #include <malloc.h> +@@ -1205,6 +1207,9 @@ + #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), +@@ -1236,6 +1241,9 @@ + + BLOCK_INPUT_ALLOC; + __malloc_hook = old_malloc_hook; ++#ifdef __GNUC__ ++ __asm __volatile("":::"memory"); ++#endif + #ifdef DOUG_LEA_MALLOC + mallopt (M_TOP_PAD, malloc_hysteresis * 4096); + #else +@@ -1285,6 +1293,9 @@ + + BLOCK_INPUT_ALLOC; + __realloc_hook = old_realloc_hook; ++#ifdef __GNUC__ ++ __asm __volatile("":::"memory"); ++#endif + + #ifdef GC_MALLOC_CHECK + if (ptr) |