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

Re: Question on BIGGEST_ALIGNMENT in GCC on NetBSD/m68k





Le 16/06/2025 à 10:14, John Paul Adrian Glaubitz a écrit :
On Mon, 2025-06-16 at 10:00 +0200, Laurent Vivier wrote:
Could you point me to these packages which assume 2 bytes alignment? I'm genuinely
interested as I would like to put these up on the wiki. So far I haven't found any.

I have used Debian's rebootstrap to create an initial set of m68k packages with
4 bytes alignment and didn't run into any problems yet.

The Gentoo developers have also successfully created a chroot with 4 bytes alignment:

https://dev.gentoo.org/~dilfridge/m68k/

I have tried it and it worked fine for me with qemu-user.

So, if there is any software that is incompatible with 4 bytes alignment on m68k, I
would like to hear about it.

qemu-user is one of these softwares that know m68k has alignment of
2byte. All the structures translated from the m68k chroot to the host
kernel are with a 2byte alignment.

And yet it works without any problems so far. Please try the Gentoo chroot yourself.


Because most of the structures are correctly aligned by default, but some of them not. You must run glibc test suite and LTP to be sure there is no regression.

In QEMU, alignment is defined here:

include/user/abitypes.h

for m68k the values to change are:

#ifdef TARGET_M68K
#define ABI_INT_ALIGNMENT 2
#define ABI_LONG_ALIGNMENT 2
#define ABI_LLONG_ALIGNMENT 2
#endif

And there will be a problem with binfmt_misc because we can't rely on the ELF signature to know which qemu-user to run, the one with 2byte alignment or the one with 4byte alignment?

Thanks,
Laurent


Reply to: