aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emacs/25.3/01_all_gc-align-sparc.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/emacs/25.3/01_all_gc-align-sparc.patch b/emacs/25.3/01_all_gc-align-sparc.patch
new file mode 100644
index 0000000..b76cf99
--- /dev/null
+++ b/emacs/25.3/01_all_gc-align-sparc.patch
@@ -0,0 +1,31 @@
+Fix segmentation fault on sparc64 with 32 bit userland.
+https://bugs.gentoo.org/647238
+
+Backported from upstream git:
+
+commit db64a866f6971c5d63565253c0c8d8db15d4a4dc
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Tue Mar 20 09:54:20 2018 -0700
+
+ Port to 32-bit sparc64
+
+ Problem reported by Ulrich Mueller; fix suggested by Eli Zaretskii
+ and Andreas Schwab (Bug#30855).
+ * src/alloc.c (mark_memory): Call mark_maybe_object only on
+ pointers that are properly aligned for Lisp_Object.
+
+--- emacs-25.3-orig/src/alloc.c
++++ emacs-25.3/src/alloc.c
+@@ -4892,7 +4892,11 @@
+ for (pp = start; (void *) pp < end; pp += GC_POINTER_ALIGNMENT)
+ {
+ mark_maybe_pointer (*(void **) pp);
+- mark_maybe_object (*(Lisp_Object *) pp);
++
++ verify (alignof (Lisp_Object) % GC_POINTER_ALIGNMENT == 0);
++ if (alignof (Lisp_Object) == GC_POINTER_ALIGNMENT
++ || (uintptr_t) pp % alignof (Lisp_Object) == 0)
++ mark_maybe_object (*(Lisp_Object *) pp);
+ }
+ }
+