commit:     1af0cd151374d5dfafab3a89d0c79f17f69dcdde
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 19 14:36:54 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Feb 19 14:36:54 2017 +0000
URL:        https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=1af0cd15

Fix compilation with glibc-2.24.

 emacs/23.4/27_all_conftest-doug-lea.patch | 46 ++++++++++++++++++++++
 emacs/23.4/28_all_gmalloc.patch           | 65 +++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)

diff --git a/emacs/23.4/27_all_conftest-doug-lea.patch 
b/emacs/23.4/27_all_conftest-doug-lea.patch
new file mode 100644
index 0000000..d4a79b8
--- /dev/null
+++ b/emacs/23.4/27_all_conftest-doug-lea.patch
@@ -0,0 +1,46 @@
+Fix segmentation fault in emacs during compile phase.
+https://bugs.gentoo.org/602992
+
+Backported from Emacs 24:
+
+commit 4b5b5289577b4cc89ee45595832f943ef9a43de6
+Author: Paul Eggert <[email protected]>
+Date:   Sat Apr 21 23:56:42 2012 -0700
+
+    * configure.in (doug_lea_malloc): Check for __malloc_initialize_hook.
+
+--- emacs-23.4-orig/configure.in
++++ emacs-23.4/configure.in
+@@ -1505,17 +1505,21 @@
+ # Do the opsystem or machine files prohibit the use of the GNU malloc?
+ # Assume not, until told otherwise.
+ GNU_MALLOC=yes
+-doug_lea_malloc=yes
+-AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
+-AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
+-AC_CACHE_CHECK(whether __after_morecore_hook exists,
+-             emacs_cv_var___after_morecore_hook,
+-[AC_TRY_LINK([extern void (* 
__after_morecore_hook)();],[__after_morecore_hook = 0],
+-  emacs_cv_var___after_morecore_hook=yes,
+-  emacs_cv_var___after_morecore_hook=no)])
+-if test $emacs_cv_var___after_morecore_hook = no; then
+-  doug_lea_malloc=no
+-fi
++
++AC_CACHE_CHECK(
++  [whether malloc is Doug Lea style],
++  [emacs_cv_var_doug_lea_malloc],
++  [AC_LINK_IFELSE(
++     [AC_LANG_PROGRAM(
++      [[#include <malloc.h>
++        static void hook (void) {}]],
++      [[malloc_set_state (malloc_get_state ());
++        __after_morecore_hook = hook;
++        __malloc_initialize_hook = hook;]])],
++     [emacs_cv_var_doug_lea_malloc=yes],
++     [emacs_cv_var_doug_lea_malloc=no])])
++doug_lea_malloc=$emacs_cv_var_doug_lea_malloc
++
+ if test "${system_malloc}" = "yes"; then
+   GNU_MALLOC=no
+   GNU_MALLOC_reason="

diff --git a/emacs/23.4/28_all_gmalloc.patch b/emacs/23.4/28_all_gmalloc.patch
new file mode 100644
index 0000000..275f634
--- /dev/null
+++ b/emacs/23.4/28_all_gmalloc.patch
@@ -0,0 +1,65 @@
+Fix endless calloc loop causing temacs to hang.
+https://bugs.gentoo.org/602992
+https://bugs.gentoo.org/609680
+
+Backported from Emacs 25:
+
+commit 4b1436b702d56eedd27a0777fc7232cdfb7ac4f6
+Author: Wolfgang Jenkner <[email protected]>
+Date:   Sat Dec 26 12:12:02 2015 -0800
+
+    Always define gmalloc etc. in src/gmalloc.c
+
+--- emacs-23.4-orig/src/gmalloc.c
++++ emacs-23.4/src/gmalloc.c
+@@ -83,6 +83,14 @@
+ 
+ #endif        /* _MALLOC_INTERNAL.  */
+ 
++#undef malloc
++#undef realloc
++#undef calloc
++#undef free
++#define malloc gmalloc
++#define realloc grealloc
++#define calloc gcalloc
++#define free gfree
+ 
+ #ifdef        __cplusplus
+ extern "C"
+@@ -1943,6 +1951,35 @@
+ 
+ #endif        /* Not ELIDE_VALLOC.  */
+ 
++#undef malloc
++#undef realloc
++#undef calloc
++#undef free
++
++void *
++malloc (size_t size)
++{
++  return gmalloc (size);
++}
++
++void *
++calloc (size_t nmemb, size_t size)
++{
++  return gcalloc (nmemb, size);
++}
++
++void
++free (void *ptr)
++{
++  gfree (ptr);
++}
++
++void *
++realloc (void *ptr, size_t size)
++{
++  return grealloc (ptr, size);
++}
++
+ #ifdef GC_MCHECK
+ 
+ /* Standard debugging hooks for `malloc'.

Reply via email to