From owner-freebsd-emulation@FreeBSD.ORG Sat Apr 19 19:07:52 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C3151065672 for ; Sat, 19 Apr 2008 19:07:52 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from cavuit01.kulnet.kuleuven.be (cavuit01.kulnet.kuleuven.be [134.58.240.43]) by mx1.freebsd.org (Postfix) with ESMTP id 8BC508FC28 for ; Sat, 19 Apr 2008 19:07:51 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from smtps02.kuleuven.be (smtpshost02.kulnet.kuleuven.be [134.58.240.75]) by cavuit01.kulnet.kuleuven.be (Postfix) with ESMTP id 46D517B8048; Sat, 19 Apr 2008 21:07:45 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtps02.kuleuven.be (Postfix) with ESMTP id D4FC5F3862; Sat, 19 Apr 2008 21:07:44 +0200 (CEST) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.2/8.14.2) with ESMTP id m3JJ7iWT028653; Sat, 19 Apr 2008 21:07:44 +0200 (CEST) (envelope-from tijl@ulyssis.org) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Tijl Coosemans To: freebsd-emulation@freebsd.org Date: Sat, 19 Apr 2008 21:07:43 +0200 User-Agent: KMail/1.9.7 References: <480921B2.6030004@inode.at> <200804191746.12611.tijl@ulyssis.org> <15571435@bb.ipt.ru> In-Reply-To: <15571435@bb.ipt.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804192107.44258.tijl@ulyssis.org> X-KULeuven-Information: Katholieke Universiteit Leuven X-KULeuven-Scanned: Found to be clean X-Spam-Status: not spam, SpamAssassin (not cached, score=-50, required 5, autolearn=disabled, KUL_SMTPS -50.00) X-KULeuven-Envelope-From: tijl@ulyssis.org Cc: Subject: Re: googleearth & skype trouble 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: Sat, 19 Apr 2008 19:07:52 -0000 On Saturday 19 April 2008 18:50:28 Boris Samorodov wrote: > On Sat, 19 Apr 2008 17:46:11 +0200 Tijl Coosemans wrote: >> Actually, this is a known problem with linux_base-fc4 and 2.4.2 >> emulation. It pops up on the mailinglists now and then so it's starting >> to become a faq. >> >> One of the solutions is to create a softlink: >> >> ln -f ../../lib/librt.so.1 /compat/linux/usr/lib/librt.so.1 >> >> That way, the linux compat open(2) syscall never returns the FreeBSD >> librt.so.1 and the linker eventually finds the 2.4.2 compatible version >> /compat/linux/lib/obsolete/linuxthreads/librt.so.1. > > But does it really helps to skype or googleearth? I don't know, but they'll at least get past this problem. >> Somebody should at this to a post-install target in the port/package, >> because /compat/linux/bin/ls and some others are affected as well. > > The case with linux bin/ls imho is an other one. When you run > /compat/linux/bin/sh and run any command you don't get linux programs > running at the first place: Under linux sh you do get linux programs when they exist. Running ls or any shell script (like Maple/Matlab/... install and startup scripts) under linux /bin/sh currently does not work with fc4 and osrelease=2.4.2. This is not really a bug of linux compat, but is because of the following: 1. opening /path/to/somefile under linux compat first tries /compat/linux/path/to/somefile then /path/to/somefile. 2. linux binaries have two search paths for librt.so.1: /lib and /usr/lib. 3. fc4 has a librt.so.1 in /lib but it is rejected under 2.4.2 emulation. 4. fc4 does not have a librt.so.1 under /usr/lib so when the runtime linker tries this search path it ends up opening FreeBSD /usr/lib/librt.so.1 (because of point 1) and fails. By adding a softlink in /compat/linux/usr/lib to the librt.so.1 in /compat/linux/lib, the linker doesn't open the FreeBSD librt.so.1 anymore. Instead, under 2.4.2, it rejects this lib and then tries an internal search path /lib/obsolete/linuxthreads where it finds the correct version. Under 2.6.16 the softlink doesn't change anything, so imho this is something the fc4 port/package should deal with. > ----- > % /compat/linux/bin/sh > > bsam@.ipt.ru$ uname -a > Linux host.ipt.ru 2.6.16 FreeBSD 7.0-STABLE #2: Fri Apr 18 01:36:58 MSD 2008 i686 i686 i386 GNU/Linux > > bsam@.ipt.ru$ file `which ls` > /bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 7.0 (700103), dynamically linked (uses shared libs), FreeBSD-style, stripped > ----- Both file and which here are FreeBSD binaries so you're not under linux compat. FreeBSD file ends up opening FreeBSD /bin/ls. If there were a linux "file" binary, "file /bin/ls" would open /compat/linux/bin/ls.