From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 2 01:54:10 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C8D016A41B for ; Sun, 2 Dec 2007 01:54:10 +0000 (UTC) (envelope-from ntarmos@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 8221313C474 for ; Sun, 2 Dec 2007 01:54:09 +0000 (UTC) (envelope-from ntarmos@ceid.upatras.gr) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id A17B5EB4DC3 for ; Sun, 2 Dec 2007 03:30:17 +0200 (EET) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 8941915766D for ; Sun, 2 Dec 2007 03:30:17 +0200 (EET) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DI6lLKCYhnC5 for ; Sun, 2 Dec 2007 03:30:17 +0200 (EET) Received: from ace.netcins.ceid.upatras.gr (vfppp079167010191.dsl.hol.gr [79.167.10.191]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 3C6DB1576E8 for ; Sun, 2 Dec 2007 03:30:17 +0200 (EET) Received: by ace.netcins.ceid.upatras.gr (Postfix, from userid 1001) id 8D0AB3F457; Sun, 2 Dec 2007 03:30:10 +0200 (EET) Date: Sun, 2 Dec 2007 03:30:10 +0200 From: Nikos Ntarmos To: freebsd-hackers@freebsd.org Message-ID: <20071202013010.GA6198@ace.netcins.ceid.upatras.gr> Mail-Followup-To: freebsd-hackers@freebsd.org References: <1196470143.4750af7f6accf@webmail.rawbw.com> <20071201162930.5c9fd4dd@deskjail> <20071201230022.R74097@fledge.watson.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; x-action=pgp-signed Content-Disposition: inline In-Reply-To: <20071201230022.R74097@fledge.watson.org> Organization: NetCInS Lab., C.E.I.D., U. of Patras, Greece WWW-Homepage: http://ntarmos.dyndns.org/ X-PGP-Fingerprint: 9680 60A7 DE60 0298 B1F0 9B22 9BA2 7569 CF95 160A Office-Phone: +30-2610-996919 Office-Fax: +30-2610-969011 GPS-Info: 38.31N, 21.82E User-Agent: mutt-ng/devel-r804 (FreeBSD) Subject: Re: Linux executable picks up FreeBSD library over linux one and breaks X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 01:54:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Dec 01, 2007 at 11:01:46PM +0000, Robert Watson wrote: > > 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? The problem mainly arises when a library appears earlier in the search path in the underlying view of the file system than in the Linux view. (e.g. there is no /compat/linux/path1/lib/libX.so.y but there is a /path2/libX.so.y and path2 appears before path1 in the ld search path). X-related libraries are a good example; since we moved to a ${LOCALBASE}-based X hierarchy, all X-based dynamically-linked linux binaries pick up the native X libraries (i.e. from /usr/local/lib), unless advised otherwise (e.g. via LD_LIBRARY_PATH=/compat/linux/usr/X11R6/lib:$LD_LIBRARY_PATH). Symbolic links do work. Another solution is to rearrange dynamic libraries under /compat/linux so that they match the FreeBSD hierarchy (and teach ld-linux to use the same search path as the native loader). And yet another solution is to teach the linuxolator to first do an exhaustive search for libraries under /compat/linux and only then fall back to native ones (this seems similar to the above LD_LIBRARY_PATH incantation). Just my $0.02. \n\n -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Nikos Ntarmos iD8DBQFHUgqim6J1ac+VFgoRAunbAJ4/zMkaKVO4Nuu5ddyjww1WIzdtQACeOq7C i4a+uIyjPXAHfghAhfOgs9M= =qKI+ -----END PGP SIGNATURE-----