A memory alignment problem causing m68k failures has been fixed
authorAndreas Schwab <schwab@linux-m68k.org>
Mon, 24 Jul 2017 23:12:50 +0000 (01:12 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 17 Aug 2017 18:29:59 +0000 (19:29 +0100)
This patch has been backported from upstream to fix m68k build
failures:

  Properly align global lispsym

  * lib-src/make-docfile.c (close_emacs_globals): Wrap struct
  Lisp_Symbols inside struct.
  * src/alloc.c (sweep_symbols): Update use of lispsym.
  * src/lisp.h (builtin_lisp_symbol): Likewise.

Origin: backport, commit: 7a4d9f6304cffa39642507609605bcbfa40d4675
Bug-Debian: http://bugs.debian.org/868868
Forwarded: not-needed

Gbp-Pq: Name 0009-A-memory-alignment-problem-causing-m68k-failures-has.patch

lib-src/make-docfile.c
src/alloc.c
src/lisp.h

index 29061b76b2634755236e00753f83176d65005429..bd268553248b897e92971866394f356743ba65c0 100644 (file)
@@ -667,7 +667,9 @@ close_emacs_globals (ptrdiff_t num_symbols)
           "#ifndef DEFINE_SYMBOLS\n"
           "extern\n"
           "#endif\n"
-          "struct Lisp_Symbol alignas (GCALIGNMENT) lispsym[%td];\n"),
+          "struct {\n"
+          "  struct Lisp_Symbol alignas (GCALIGNMENT) s;\n"
+          "} lispsym[%td];\n"),
          num_symbols);
 }
 
index 68bee7728c0b0af886d65c087cbd0d48f13f94f4..9a96a425071eaeb196b41543d0433f9bfa4c72e5 100644 (file)
@@ -6823,7 +6823,7 @@ sweep_symbols (void)
   symbol_free_list = NULL;
 
   for (int i = 0; i < ARRAYELTS (lispsym); i++)
-    lispsym[i].gcmarkbit = 0;
+    lispsym[i].s.gcmarkbit = 0;
 
   for (sblk = symbol_block; sblk; sblk = *sprev)
     {
index 5aee80cea118987c965fb4979caae427e02a0140..08c40dc3795b77f192b9c01a64202ca191d39823 100644 (file)
@@ -1110,7 +1110,7 @@ make_lisp_symbol (struct Lisp_Symbol *sym)
 INLINE Lisp_Object
 builtin_lisp_symbol (int index)
 {
-  return make_lisp_symbol (lispsym + index);
+  return make_lisp_symbol (&lispsym[index].s);
 }
 
 #define XSETINT(a, b) ((a) = make_number (b))