Port-m68k archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Natural alignment used on NetBSD/m68k
On Sat, 2025-02-15 at 17:49 +0900, Izumi Tsutsui wrote:
> > Thanks a lot for the test, also for testing with NetBSD 1.5.3.
> >
> > Would you performing the same exact test on a current version of NetBSD?
>
> Already attached with the 1.5.3 result
> (it's on NetBSD/atari 10.1 but all NetBSD/m68k ports are binary compatible):
> https://mail-index.netbsd.org/port-m68k/2025/02/08/msg000914.html
>
> ---
> milan-% file a.out
> a.out: ELF 32-bit MSB executable, Motorola m68k, 68020, version 1 (SYSV), dynamically linked, interpreter /usr/libexec/ld.elf_so, for NetBSD 10.1, with debug_info, not stripped
> milan-% ./a.out
> struct test { char x; int y; };
> sizeof(struct test) = 8
> offsetof(struct test, y) = 4
> milan-%
Oops, I somehow missed the lower part of your mail completely. Sorry!
Thanks a lot for testing.
FWIW, here is the result of the very same test code on Linux/m68k:
glaubitz@mitchy:~$ uname -a
Linux mitchy 6.2.0-rc3-virt-00063-gfb879e581032 #44 Thu Jan 12 15:35:35 UTC 2023 m68k GNU/Linux
glaubitz@mitchy:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/m68k-linux-gnu/13/lto-wrapper
Target: m68k-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 13.3.0-12' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,fortran,objc,obj-c++,m2 --prefix=/usr --
with-gcc-major-version-only --program-suffix=-13 --program-prefix=m68k-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix -
-libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --
disable-libssp --disable-libitm --disable-libsanitizer --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror
--disable-werror --disable-multilib --enable-checking=release --build=m68k-linux-gnu --host=m68k-linux-gnu --target=m68k-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.0 (Debian 13.3.0-12)
glaubitz@mitchy:~$ dmesg | head -8
[ 0.000000] Linux version 6.2.0-rc3-virt-00063-gfb879e581032 (glaubitz@node54) (m68k-suse-linux-gcc (SUSE Linux) 11.3.0, GNU ld (GNU Binutils; SUSE Linux Enterprise 15) 2.37.20211103-150100.7.37)
#44 Thu Jan 12 15:35:35 UTC 2023
[ 0.000000] random: crng init done
[ 0.000000] earlycon: early_gf_tty0 at MMIO 0xff008000 (options '')
[ 0.000000] printk: bootconsole [early_gf_tty0] enabled
[ 0.000000] Zone ranges:
[ 0.000000] DMA [mem 0x0000000000000000-0x00000cf7fdffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
glaubitz@mitchy:~$ cat test.c
#include <stdio.h>
#include <stdlib.h>
#define offsetof(type, member) ((size_t)(unsigned long)(&((type *)0)->member))
struct test { char x; int y; };
int main()
{
printf("struct test { char x; int y; };\n");
printf("sizeof(sturct test) = %d\n", sizeof(struct test));
printf("offsetof(struct test, y) = %d\n", offsetof(struct test, y));
}
glaubitz@mitchy:~$ cc test.c
glaubitz@mitchy:~$ file a.out
a.out: ELF 32-bit MSB executable, Motorola m68k, 68020, version 1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, BuildID[sha1]=a00f49a8cc806d23f7e5994c3a02a5dea3455a67, for GNU/Linux 3.2.0, not
stripped
glaubitz@mitchy:~$ ./a.out
struct test { char x; int y; };
sizeof(sturct test) = 6
offsetof(struct test, y) = 2
glaubitz@mitchy:~$
Thanks,
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