From owner-freebsd-emulation@FreeBSD.ORG Sun Dec 2 09:22:07 2007 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E51D16A419; Sun, 2 Dec 2007 09:22:07 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id CC25513C457; Sun, 2 Dec 2007 09:22:06 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A57251.dip.t-dialin.net [84.165.114.81]) by redbull.bpaserver.net (Postfix) with ESMTP id 7EED22E2B9; Sun, 2 Dec 2007 10:21:33 +0100 (CET) Received: from deskjail (deskjail.Leidinger.net [192.168.1.109]) by outgoing.leidinger.net (Postfix) with ESMTP id E3AE9773AB; Sun, 2 Dec 2007 10:21:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1196587291; bh=HdfbuS7xodCQH8rlG4+muyeQNYLngj/P8 MzojY0HCqA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To: References:X-Mailer:Mime-Version:Content-Type: Content-Transfer-Encoding; b=aL2obpQAlxcyYAD+9YXOhEn4hepBqiVQX+4a1 DWvSNnHJTr7VuX2qjjwOF0EKaBst7wrEKxMQBpmt3/CNjDbbtrTnxJPqXWvB2FashjY N/2MdWPS4Wi/h2C+RH93FVgyCbFrnmk4UnN1ZKlZwfUIC4wruXw13eNbpV6xItBUa5X lXeh9w7piM9uWvEm5j3hPXiHx7Qm2Mo1bYElBnOuvOyDhCxI4vRpis4lOXenCJnVBzu C8mWhERxUcY4RKkLbngsgjQmWSnEw4HPp5lzOVCbG/dGRqOoju8ymYKW0CsufgMnZIW bh7SE3FeT6jq8ITX+TmrznSfR4yATtsyEbNVA== Date: Sun, 2 Dec 2007 10:21:30 +0100 From: Alexander Leidinger To: Robert Watson 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> X-Mailer: Claws Mail 3.0.1 (GTK+ 2.10.14; i686-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-14.9, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, RDNS_DYNAMIC 0.10) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: emulation@freebsd.org, freebsd-hackers@freebsd.org, Yuri Subject: Re: Linux executable picks up FreeBSD library over linux one and breaks X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2007 09:22:07 -0000 Quoting Alexander Leidinger (Sun, 2 Dec 2007 10:07:55 +0100): > Quoting Robert Watson (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