Port-m68k archive

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

Re: Natural alignment used on NetBSD/m68k



Hi,

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.

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.

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 :)

John


Home | Main Index | Thread Index | Old Index