From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 5 11:29:55 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 6CA5416A417 for ; Wed, 5 Dec 2007 11:29:55 +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 C599C13C46B for ; Wed, 5 Dec 2007 11:29:54 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A5422C.dip.t-dialin.net [84.165.66.44]) by redbull.bpaserver.net (Postfix) with ESMTP id 5ABB62E113; Wed, 5 Dec 2007 12:21:26 +0100 (CET) Received: from webmail.leidinger.net (webmail.Leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id D0C1C78C98; Wed, 5 Dec 2007 12:21:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1196853683; bh=mo9+SOxQ0TFsoS/5YnsbqSvBge7/SLxg7 KTuDvgyKNg=; h=Message-ID:X-Priority:Date:From:To:Cc:Subject: References:In-Reply-To:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:User-Agent; b=LRdqh1 iKTmzm9A4zvouYWWd0k0yGpTwjFR4RjJXlYMfC/tXQw143WmBUab51PahPB5MZwNxhJ 45W3T+Sr3L7a87K7HgCd+9dIF57wmZtkVDSvMmBi0ovPq0WmBtbgaIk2WyiqilYxf7t ycr8g8zmvuHT5DYdfRfbqljvVZcEX7TXO32IjPXSXYPisf8ZI2t3nCEUq4IieCpO9nL Xd9pQbm1fa/nssWPu6bPr9qzeSU2c2SKkaujUY+uOc16Ry+vyMSah/yaq8ST93SNeGQ KdFEZZt5t3ORKW2JJeMicHt2VeUFnntNRcEmZotL5uMDnane0Mz/+ptIIZ27iYv1PMV w== Received: (from www@localhost) by webmail.leidinger.net (8.14.1/8.13.8/Submit) id lB5BLNuQ047644; Wed, 5 Dec 2007 12:21:23 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde MIME library) with HTTP; Wed, 05 Dec 2007 12:21:23 +0100 Message-ID: <20071205122123.phwu6uh7jksgcwk8@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Wed, 05 Dec 2007 12:21:23 +0100 From: Alexander Leidinger To: Chuck Robey References: <1196470143.4750af7f6accf@webmail.rawbw.com> <4752F825.8020505@chuckr.org> <20071203144159.irjelm2c0c8o8csw@webmail.leidinger.net> <47544B5A.9080903@chuckr.org> In-Reply-To: <47544B5A.9080903@chuckr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) / FreeBSD-7.0 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 X-Mailman-Approved-At: Wed, 05 Dec 2007 12:54:03 +0000 Cc: Yuri , freebsd-hackers@freebsd.org 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: Wed, 05 Dec 2007 11:29:55 -0000 Quoting Chuck Robey (from Mon, 03 Dec 2007 =20 13:30:50 -0500): > Alexander Leidinger wrote: >> Quoting Chuck Robey (from Sun, 02 Dec 2007 =20 >> 13:23:33 -0500): >> >>> You've gotten some good suggestions, but I might add one more, I don't >>> think it's been mentioned. I have foound, myself in the last 2 weeks, >>> some FreeBSD ports putting in Linux tools, installing stuff in the >>> wrong places, like sticking in SYSV libraries in /usr/local/lib instead >>> of /compat/linux/usr/lib. I verified in that case that the Linux >> >> If they put the libs directly in /usr/local/lib instead of =20 >> /usr/local/lib/, then it is a big =20 >> error. But if it is in a subdirectory where no FreeBSD lib resides, =20 >> it is ok (the linux browser sets LD_LIBRARY_PATH in the start =20 >> script to the right path). >> >> Have a look how the native browser works, the private libs are not =20 >> in ldconfig either and the browser start script sets the library =20 >> path for the browser binary. At least it did this the last time I =20 >> checked... >> > > Does that mean that all programs needing those libs must have wrapper > shells, so as ot implement the LD_LIBRARY_PATH? I know of programs Yes. For the mozilla stuff it seems to be a design decision of them to =20 put the libs in a non-standard path (this is independent from the OS). =20 Don't shoot FreeBSD, shoot them if you don't like this. > that bomb if that's even set at all, and I think it can be a security > tool, and I just think that there is no good reason for installing > Linux libs outside of the compat tree. There isn't any good reason not You have 2 differet issue here. One issue is that some =20 program(-suites) decide to put their libs into a non-standard =20 directory. The other one is that you should not mix libs from linux =20 and FreeBSD. > to use the compat tree, is there? You know, there's a local there too, > so you don't even need to be ignoring LOCALBASE, which is something I > don't care for ports to do at all. Even if you have them in LINUXBASE, you could pick up the wrong libs =20 depending on the search order of the libs directories and the location =20 of the libs. The big goal is, that an user should not have the need to put =20 /compat/linux/... into his path to start a linux program. We can do =20 this by putting those linux programs into LOCALBASE (easy, if they =20 don't install libs or hide the libs in special dirs), or by putting =20 them into LINUXBASE and add a wrapper script to LOCALBASE (not as =20 easy, as you have to have more knowledge about pkg-plist in the ports =20 to get the port to do the right thing). For pure infrastructure ports (which just have linux libs), I enforce =20 the rule that they have to be in LINUXBASE as soon as I encounter a =20 port which violates this rule. For application programs I go the =20 relaxed way: fix the problem in case there's one and I get aware of it. > I just don't see any reason for such a obviously pathological thing to > occur. Just because it's possible to fix it, program by program, by > implementing wrapper scripts, you aren't going to tell me that's some > sort of elegant fix, so the fact that doing such a thing is justified? I don't think that wrapper scripts are elegant in general, but our =20 linuxulator is a special environment and if you want that other people =20 with "normal" knowledge (read: no ports committer... and even _some_ =20 ports committers would have to learn some new things to get it right) =20 are able to produce a linux port (there are already some special rules =20 to take care about with linux ports, several of them we managed to =20 cover behind some easy knobs), you have to come up with a compromise. Feel free to propose other solutions, but before you propose anything, =20 I suggest you try to write a port which implements your solution to =20 get an idea how complex it is in reality. Bye, Alexander. --=20 I've always made it a solemn practice to never drink anything stronger than tequila before breakfast. =09=09-- R. Nesson http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID =3D B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID =3D 72077137