[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#963108: perl: Please include minor patch to fix FTBFS on m68k



Source: perl
Version: 5.32.0~rc1-1
Severity: normal
Tags: patch
User: debian-68k@lists.debian.org
Usertags: m68k

Hi!

perl currently fails to build from source on m68k in experimental due to
an alignment issue. On m68k, the natural alignment is 16 bits which causes
the opslot member of "struct opslab" to be aligned at a 16-bit offset.

On other 32-bit and 64-bit architectures, the alignment is at least 32 bits,
so the offset is always guaranteed to be 32-bit aligned.

The attached patch fixes the problem by adding an additional 16 bits padding
before the opslot member which causes the alignment of opslot to be 32 bits.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>From 3585dd865baaa3c631964fbba758491b26ef954a Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Fri, 19 Jun 2020 07:42:08 +0200
Subject: [PATCH] op.h: Add additional padding to struct opslab to ensure
 proper alignment

On architectures where the native alignment is less than 4 bytes such as
Motorola 68000 (m68k), we need an additional padding of 2 bytes such that
the offset of the slots inside the slabs is correct.
---
 op.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/op.h b/op.h
index fc21f03cda..fb9f538e23 100644
--- a/op.h
+++ b/op.h
@@ -714,6 +714,7 @@ struct opslab {
 # ifdef PERL_DEBUG_READONLY_OPS
     bool	opslab_readonly;
 # endif
+    U16         opslab_padding;		/* padding to ensure proper alignment */
     OPSLOT	opslab_slots;		/* slots begin here */
 };
 
-- 
2.27.0


Reply to: