Subject: Re: 2.x and COMPAT_NETBSD32
To: None <port-amd64@netbsd.org>
From: Quentin Garnier <cube@cubidou.net>
List: port-amd64
Date: 03/09/2006 21:29:43
--TbSr5s+wTV5WAS2d
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 09, 2006 at 03:07:06PM -0500, Jan Schaumann wrote:
> Jan Schaumann <jschauma@netmeister.org> wrote:
> =20
> > My amd64 machines run NetBSD 2.x.  What are the chances of getting 2.0
> > i386 binaries to work?  I've found the COMPAT_NETBSD32 option, and the
> > netbsd32_compat16 pkgsrc packages, but nothing relating to 2.0 binaries.
> >=20
> > Do we just not have a proper netbsd32_compat20 (or even
> > netbsd32_compat30) packages?
>=20
> Well, I've populated /emul/netbsd32/usr/libexec and
> /emul/netbsd32/usr/lib on the amd64 machine with libraries from i386,
> but still no luck.  What else is needed to have amd64 run i386 binaries?
>=20
> (The kernel does have COMPAT_NETBSD32.)

The issues come from the way our compat code treats symbolic links that
point to absolute locations.  E.g., /usr/libexec/ld.so_elf.

You have several ways to workaround that:

 - run everything that have /usr/libexec/ld.so_elf as the ELF
   interpreter in a chrooted environment

 - resurrect the code I wrote a while ago to make namei() handle the
   situation, at various costs (but not performance) which made it unfit
   for our tree (but I've recently deleted it from my tree, so no luck)

 - change all the absolute symlinks in /emul/netbsd32/usr/lib* to be
   relative instead of abosulte.  This is the easiest and the cleanest,
   but it involves some work.

And note that you won't be able to run threaded programs.  Well, not
yet.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--TbSr5s+wTV5WAS2d
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBRBCQN9goQloHrPnoAQK2/Qf/VdLJJSGfd9gWx4ni3eZD+wVssKRaLjkH
oTNyi5bZQ52qIXspkAAd8Ec5odG+ag5jcYyy7x49XJ6SbFn19RpvG4nn2pGNIRJm
qdpdwkETIasmye05fFH8wE6iVF3uBxPhn/kI0rpCqE5bbOzUhMiNCkBTtoHfhd82
iT4zxOuJ0r4GQu4SyoedN/J6ArEWxK2GXP6GG5SUmjCN9cCnwEl0Ss+BTsoGtKd5
fCwdNHv8PIXH9fDOhXrqTwmk82fIk+9SuOrbK3mMlKFhDrJxVswA4/FjLq05uqX0
Bewr3EHJuJtB7Wl3GUEedpOQqKVkdQAwppfqHGnlq8/mtrBnNDhlhg==
=+H0u
-----END PGP SIGNATURE-----

--TbSr5s+wTV5WAS2d--