Subject: Re: 2.x and COMPAT_NETBSD32
To: None <>
From: Quentin Garnier <>
List: port-amd64
Date: 03/09/2006 21:29:43
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 <> 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?
> 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?
> (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

Quentin Garnier - -
"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.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.6 (NetBSD)