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

Re: Question on BIGGEST_ALIGNMENT in GCC on NetBSD/m68k



On Sun, Jun 08, 2025 at 11:10:38AM +1000, Finn Thain wrote:
> 
> On Sat, 7 Jun 2025, John Paul Adrian Glaubitz wrote:
> 
> > On Fri, 2025-06-06 at 20:20 +1000, Finn Thain wrote:
> > > Whereas, the ability to use old binaries is proof that we care about 
> > > rule #1 don't break userspace.
> > 
> > Who is "we"?
> 
> AFAICT, it's essentially everyone who contributes patches at the userspace 
> interfaces.

Since this thread also hit a non-Linux lists I just want to point
out that we (as in: NetBSD) did not break userland when adapting the
SVR4 ABI including different alignment for ELF.

I just tested it with some original 1994 NetBSD 1.0 / amiga binaries
on an amiga running NetBSD-current as of earlier today.

I started with an empty ~/aout_test directory.

I slightly shortened the lengthy and boring download sequence in the log
(back then distributions were optimized for transport via floopies - duh!)

--8<--
[~/aout_test] martin@amiga > uname -a
NetBSD amiga.aprisoft.de 10.99.14 NetBSD 10.99.14 (GENERIC) #6: Sun Jun  8 08:11:46 CEST 2025  martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/amiga/compile/GENERIC amiga
[~/aout_test] martin@amiga > file /bin/ls
/bin/ls: ELF 32-bit MSB pie executable, Motorola m68k, 68020, version 1 (SYSV), dynamically linked, interpreter /libexec/ld.elf_so, for NetBSD 10.99.14, not stripped
[~/aout_test] martin@amiga > ftp http://archive.netbsd.org/pub/NetBSD-archive/Ne tBSD-1.0/amiga/binary/base10/base10.aa
Trying [2a04:4e42:8e::262]:80 ...
ftp: Can't connect to `2a04:4e42:8e::262:80': No route to host
Trying 146.75.117.6:80 ...
Requesting http://archive.netbsd.org/pub/NetBSD-archive/NetBSD-1.0/amiga/binary/base10/base10.aa
[..]
[~/aout_test] martin@amiga > ftp http://archive.netbsd.org/pub/NetBSD-archive/Ne 
tBSD-1.0/amiga/binary/base10/base10.agh
Trying [2a04:4e42:8e::262]:80 ...
ftp: Can't connect to `2a04:4e42:8e::262:80': No route to host
Trying 146.75.117.6:80 ...
Requesting http://archive.netbsd.org/pub/NetBSD-archive/NetBSD-1.0/amiga/binary/base10/base10.ah
[..]
142449 bytes retrieved in 00:00 (818.21 KiB/s)
[~/aout_test] martin@amiga > su
Password:
[/data/home/martin/aout_test] amiga # cat base10.a* | tar xzpzf -
[/data/home/martin/aout_test] amiga # file bin/ls
bin/ls: a.out NetBSD/m68k demand paged executable @0x2020+T=114688+D=8192+B=7992
[/data/home/martin/aout_test] amiga # chroot . /bin/sh
# pwd
/
# ls -l
total 6436
drwxr-xr-x   2 0    0       512 Oct 21  1994 altroot
-rw-r--r--   1 205  100  901120 Oct 28  1994 base10.aa
-rw-r--r--   1 205  100  901120 Oct 28  1994 base10.ab
-rw-r--r--   1 205  100  901120 Oct 28  1994 base10.ac
-rw-r--r--   1 205  100  901120 Oct 28  1994 base10.ad
-rw-r--r--   1 205  100  901120 Oct 28  1994 base10.ae
-rw-r--r--   1 205  100  901120 Oct 28  1994 base10.af
-rw-r--r--   1 205  100  901120 Oct 28  1994 base10.ag
-rw-r--r--   1 205  100  142449 Oct 28  1994 base10.ah
drwxr-xr-x   2 0    0       512 Oct 21  1994 bin
drwxr-xr-x   3 0    0       512 Oct 21  1994 dev
drwxr-xr-x   8 0    0       512 Oct 21  1994 etc
drwxr-xr-x   2 0    0       512 Oct 21  1994 home
drwxr-xr-x   2 0    0       512 Oct 21  1994 mnt
drwxr-xr-x   2 0    0       512 Oct 21  1994 root
drwxr-xr-x   2 0    0      1024 Oct 21  1994 sbin
drwxr-xr-x   2 0    0       512 Oct 21  1994 stand
drwxrwxrwt   2 0    0       512 Oct 21  1994 tmp
drwxr-xr-x  14 0    0       512 Oct 21  1994 usr
drwxr-xr-x  18 0    0       512 Oct 21  1994 var
# uname -a
NetBSD amiga.aprisoft.de 10.99.14 NetBSD 10.99.14 (GENERIC) #6: Sun Jun  8 08:11:46 CEST 2025  martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/amiga/compile/GENERIC amiga
-->8--

So the 1.0 original release a.out binaries still work and a -current
kernel provides the right data (with old alignment and 32bit time_t)
for a stat(2) system call from 1994 using the a.out ABI.

Martin


Reply to: