Port-m68k archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Natural alignment used on NetBSD/m68k
Hello,
On Sat, 2025-02-08 at 11:37 +0000, John Klos wrote:
> > can anyone tell me whether NetBSD/m68k uses a natural alignment of two
> > or four bytes? I'm asking since Linux/m68k defaults to two bytes
> > alignment which has started to become a burden as more and more programs
> > require at least four bytes alignment these days. Software that is
> > affected includes CPython, LLVM, Mold, gccgo and many more.
>
> NetBSD uses four bytes.
OK, thanks for the confirmation.
Do you happen to know what other m68k Unices use such as SunOS?
> > As Debian's m68k maintainer, I have been trying to convince the
> > community to switch to four bytes alignment, but so far an agreement has
> > not been made. On the other hand, the original SysV Unix ABI released by
> > Motorola [1] defaults to four bytes alignment.
>
> I've read some of the discussions about that. Your efforts are valiant and
> appreciated. While I understand the resistance to change, what I don't
> understand is how some people can think it can or should just simply never
> change.
Yeah, it's such a frustrating discussion. But the fact that NetBSD uses four
bytes alignment is a huge argument in favor of that change.
Do you happen to know whether NetBSD has always used four bytes or did that
change in the past?
> Of course it'd be great to switch, and I've wondered if there could be
> some simple way to identify old versus new binaries so you wouldn't need a
> compatibility flag day.
>
> > And maybe someone could compile and run the following code on a
> > NetBSD/m68k instance to confirm the alignment to be four bytes:
> >
> > #include <stdio.h>
> >
> > typedef struct { char x; int y; } test_t;
> >
> > int main(void)
> > {
> > printf("%d\n", sizeof(test_t) / 2);
> > }
>
> 4 :)
Thanks a lot for the confirmation!
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Home |
Main Index |
Thread Index |
Old Index