aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2017-02-19 15:36:54 +0100
committerUlrich Müller <ulm@gentoo.org>2017-02-19 15:36:54 +0100
commit1af0cd151374d5dfafab3a89d0c79f17f69dcdde (patch)
treecf5d7d1750a6fde139f1f2be592871e26ae9c087
parentFix temacs segmentation fault due to endless calloc loop. (diff)
downloademacs-patches-1af0cd151374d5dfafab3a89d0c79f17f69dcdde.tar.gz
emacs-patches-1af0cd151374d5dfafab3a89d0c79f17f69dcdde.tar.bz2
emacs-patches-1af0cd151374d5dfafab3a89d0c79f17f69dcdde.zip
Fix compilation with glibc-2.24.emacs-23.4-patches-20
-rw-r--r--emacs/23.4/27_all_conftest-doug-lea.patch46
-rw-r--r--emacs/23.4/28_all_gmalloc.patch65
2 files changed, 111 insertions, 0 deletions
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 <eggert@cs.ucla.edu>
+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 <wjenkner@inode.at>
+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'.