Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2021 12:39:30 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Thomas David Rivers <rivers@dignus.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: 32-bit executables on aarch64?
Message-ID:  <DCB25333-0B09-4610-9BCB-DB6C83B6F203@yahoo.com>
In-Reply-To: <202103311826.12VIQwxD038077@office.dignus.com>
References:  <202103311826.12VIQwxD038077@office.dignus.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2021-Mar-31, at 11:26, Thomas David Rivers <rivers at dignus.com> =
wrote:

> marklmi@yahoo.com  wrote:
>> armv7# file `which uname`
>> /usr/bin/uname: ELF 32-bit LSB executable, ARM, EABI5 version 1 =
(FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, =
FreeBSD-style, for FreeBSD 14.0 (1400005), not stripped
>>=20
>> armv7# uname -apKU
>> FreeBSD RPi4B 14.0-CURRENT FreeBSD 14.0-CURRENT =
mm-src-n245445-def0058cc690 GENERIC-NODBG  arm armv7 1400005 1400005
>>=20
>> (I did both buildworld builds from the same source.)
>>=20
>> There is no lib32 implementation for aarch64.
>> So, direct execution of code for armv7 FreeBSD
>> without being in such a chroot is not available.
>> (I ignore qemu and the like here.)
>>=20
>> =3D=3D=3D
>> Mark Millard
>=20
> Ah!
>=20
> So, the kernel _can_ run a 32-bit executable...

Only in a chroot to an armv7 world, not directly.
You can use the chroot's system compiler/toolchain
to build armv7 materials for use in the chroot.

powerpc64 FreeBSD on on PowerMacs has a lib32 in
the powerpc64 world and so allows 32-bit powerpc
FreeBSD coded to be used either with or without
a choot being in use to do so. amd64 and i386 are
similar. More than the kernel is involved in
avoiding the need for a chroot to be in use.

powerpc64 allows building without lib32 and
without it the handling is like for aarch64
and armv7.

> but we just can't
> build one on an aarch64 machine...

Without a lib32 in the aarch64 world, the armv7
FreeBSD code use has to be from inside an
appropriate chroot as far as I know.

> I wonder if I can "cross-build" an LLVM/dcc for armv7 and just
> cross-compile to get a 32-bit executable that executes on=20
> a 64-bit kernel.. perhaps with -static to avoid any runtime problems?

armv7 FreeBSD code use: only in an appropriate
chroot unless the lib32 has been implmented
(as is installed).

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DCB25333-0B09-4610-9BCB-DB6C83B6F203>