They don't care about this patch. I will switch the default alignment to
4 bytes in the following months since it makes absolutely no sense to
use an alignment which contradicts the official SysV ABI documentation.
Why couldn't the alignment be changed along with the ABI change for 64 bit time?
https://wiki.debian.org/ReleaseGoals/64bit-time
FWIW, NetBSD uses 4 bytes alignment on m68k which means they don't have to rely
on constantly having to patch projects to build with 2 byte alignment.
Even the sun2 port, which is for the m68010 (an actual machine which might benefit from a 2 byte alignment) uses 4 byte alignment in NetBSD.
They don't care about this patch. I will switch the default alignment to
4 bytes in the following months since it makes absolutely no sense to
use an alignment which contradicts the official SysV ABI documentation.
FWIW, NetBSD uses 4 bytes alignment on m68k which means they don't have to rely
on constantly having to patch projects to build with 2 byte alignment.
Even the sun2 port, which is for the m68010 (an actual machine which
might benefit from a 2 byte alignment) uses 4 byte alignment in NetBSD.
Well, the official SysV ELF ABI by AT&T uses 4 byte alignment, so I would expect
any *nix flavor which adheres to the official specification to use 4 byte alignment.
On Mon, 12 May 2025 at 19:01, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:
Well, the official SysV ELF ABI by AT&T uses 4 byte alignment, so I would expect
any *nix flavor which adheres to the official specification to use 4 byte alignment.
Just wondering, does Amiga Unix SVR4 ("AMIX") follow this?
On Tue, 2025-05-13 at 09:55 +0200, Geert Uytterhoeven wrote:
On Mon, 12 May 2025 at 19:01, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:
Well, the official SysV ELF ABI by AT&T uses 4 byte alignment, so I would expect
any *nix flavor which adheres to the official specification to use 4 byte alignment.
Just wondering, does Amiga Unix SVR4 ("AMIX") follow this?
I can try to ask the Amiga community if they can run the test program on AMIX.
Does AMIX use ELF or a.out?
Well, the official SysV ELF ABI by AT&T uses 4 byte alignment, so I would expect
any *nix flavor which adheres to the official specification to use 4 byte alignment.
Just wondering, does Amiga Unix SVR4 ("AMIX") follow this?
I can try to ask the Amiga community if they can run the test program on AMIX.
Does AMIX use ELF or a.out?
Dunno, probably ELF, as ELF originated on SVR4.
There is a guide available which explains how to install AMIX on WinUAE:
https://www.amigaunix.com/doku.php/installation
https://oldosplayground.blogspot.com/2018/01/amiga-unix-amix-21-installation.html
I will try that later this week. I'm really curios to learn whether they're using ELF with 4 bytes alignment.
On Tue, 2025-05-13 at 22:08 +0200, John Paul Adrian Glaubitz wrote:
There is a guide available which explains how to install AMIX on WinUAE:
https://www.amigaunix.com/doku.php/installation
https://oldosplayground.blogspot.com/2018/01/amiga-unix-amix-21-installation.html
I will try that later this week. I'm really curios to learn whether they're using ELF with 4 bytes alignment.
I have kicked off the installation of AMIX 2.1 on WinUAE now.
It actually looks very streamlined and user-friendly ;-).
Let's see if I can get to compile the sample program and see what the alignment says.
You can use __alignof__() to have the data type alignment:
int main(void)
{
printf("alignof(short) %ld\n", __alignof__(short));
printf("alignof(int) %ld\n", __alignof__(int));
printf("alignof(long) %ld\n", __alignof__(long));
printf("alignof(long long) %ld\n", __alignof__(long long));
}
On x86_64, it gives:
alignof(short) 2
alignof(int) 4
alignof(long) 8
alignof(long long) 8
Since GCC 2.x (1992)
https://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC89
It's a gcc extension.
For other compilers, we need to use _Alignof() from C11.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 491 |
Nodes: | 16 (2 / 14) |
Uptime: | 100:22:38 |
Calls: | 9,681 |
Calls today: | 2 |
Files: | 13,725 |
Messages: | 6,174,825 |