Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2007 10:21:30 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        emulation@freebsd.org, freebsd-hackers@freebsd.org, Yuri <yuri@rawbw.com>
Subject:   Re: Linux executable picks up FreeBSD library over linux one and breaks
Message-ID:  <20071202102130.4a3f451e@deskjail>
In-Reply-To: <20071202100755.2f5704cc@deskjail>
References:  <1196470143.4750af7f6accf@webmail.rawbw.com> <20071201162930.5c9fd4dd@deskjail> <20071201230022.R74097@fledge.watson.org> <20071202100755.2f5704cc@deskjail>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Alexander Leidinger <Alexander@Leidinger.net> (Sun, 2 Dec 2007 10:07:55 +0100):

> Quoting Robert Watson <rwatson@FreeBSD.org> (Sat, 1 Dec 2007 23:01:46 +0000 (GMT)):
> 
> > 
> > On Sat, 1 Dec 2007, Alexander Leidinger wrote:
> > 
> > > Have a look at the search order of libs in linux. Correlate this with the 
> > > fact that when in linux an access is done to e.g. /lib/libX.so.y which means 
> > > that the linuxulator first looks if /compat/linux/lib/libX.so.y is there, 
> > > and if it isn't it looks if /lib/libX.so.y is available.
> > >
> > > AFAIR a work around is to add a link in /compat/linux/usr/lib/librt.so.1 -> 
> > > /lib/librt.so.1
> > >
> > > I want to do something like this in the FC4 port, but hadn't time to do it 
> > > and test it so far.
> > 
> > It sounds like the real problem is that there are some cases where we don't 
> > want the Linuxulator to merge the underlying and Linux views of the file 
> > system -- we don't want the union of /compat/linux/lib and /lib, we just want 
> > /compat/linux/lib?
> 
> Yes.
> 
> I already thought a little bit of special case /lib, /usr/lib
> and /usr/local/lib in the kernel. This doesn't catch all cases (e.g.,
> LD_LIBRARY_PATH), produces false positives (in case there's some kind
> of config file in lib which we want to fall through to the FreeBSD one
> (if the FreeBSD one is not moved to a different place by the
> corresponding port; I don't remember such a file, but we have such
> files in other places)) and looks like a hack to me.
> 
> Another idea is to special case libs (I didn't think much about this
> yet), but how to detect libs? Do we look for ^lib.*\.so{,\.[0-9]?}$,
> will this produce false positives, do we have to special case other
> files too (lib.*\.la), are there other ways of detecting a lib?

I forgot something: We also have the linux_dist ports, they install
install into /usr/local/.... They are full distributions and not a
stripped down linux emulation environment. You use them by chroot()ing
into them (or a jail). And when we use the linux ldconfig
in /comapt/linux to update the cached list of libs for linux, we also
chroot into /compat/linux. Naturally there's no /compat/linux after the
chroot. So in the chroot case special handling of the libs is forbidden.

Bye,
Alexander.

-- 
Nothing is faster than the speed of light.

To prove this to yourself, try opening the
refrigerator door before the light comes on.
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071202102130.4a3f451e>