From owner-freebsd-emulation@FreeBSD.ORG Thu Aug 24 23:10:36 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4976216A4DD for ; Thu, 24 Aug 2006 23:10:36 +0000 (UTC) (envelope-from jhein@timing.com) Received: from Daffy.timing.com (w.timing.com [206.168.13.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F9EE43D49 for ; Thu, 24 Aug 2006 23:10:35 +0000 (GMT) (envelope-from jhein@timing.com) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by Daffy.timing.com (8.13.1/8.13.1) with ESMTP id k7ONAYJt042649; Thu, 24 Aug 2006 17:10:34 -0600 (MDT) (envelope-from jhein@timing.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.13.6/8.13.6) with ESMTP id k7ONARpb057623; Thu, 24 Aug 2006 17:10:27 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.13.6/8.13.6/Submit) id k7ONAQ59057620; Thu, 24 Aug 2006 17:10:26 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17646.12770.712906.640034@gromit.timing.com> Date: Thu, 24 Aug 2006 17:10:26 -0600 From: John E Hein To: Boris Samorodov In-Reply-To: <48492411@bsam.ru> References: <17646.3029.176290.711490@yeti.mininet> <80657181@bsam.ru> <17646.6613.28038.72832@yeti.mininet> <14575472@bsam.ru> <17646.7832.330245.660064@yeti.mininet> <48492411@bsam.ru> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on Daffy.timing.com X-Virus-Status: Clean Cc: Alexander Leidinger , freebsd-emulation@freebsd.org, Markus Hoenicka Subject: Re: ports/102474: linux_base-fc-4_8 appears broken, does not allow to run Linux binaries 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: Thu, 24 Aug 2006 23:10:36 -0000 Boris Samorodov wrote at 02:28 +0400 on Aug 25, 2006: > Aha, /compat/linux/usr/bin/ldd is a script. Can't say for sure should > it work or not but something strange does exist: > ----- > 24546 ktrace RET ktrace 0 > 24546 ktrace CALL execve(0xbfbfe85e,0xbfbfe75c,0xbfbfe768) > 24546 ktrace NAMI "/compat/linux/usr/bin/ldd" > 24546 ktrace NAMI "/bin/sh" > 24546 ktrace NAMI "/libexec/ld-elf.so.1" > 24546 sh RET execve 0 ^^^^ you probably get something different if you use linux_kdump? As far as ldd goes, it calls ld-linux.so.2 (yes, the lib is executable) which is a sym link to ld-2.3.6.so file /compat/linux/lib/ld-2.3.6.so /compat/linux/lib/ld-2.3.6.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped Note the improper brandelf if it were to be run as an executable (should be GNU/Linux, not SYSV). You could copy ld-2.3.6.so to somewhere else, brandelf -t Linux it (I wouldn't do that to the real /compat/linux/lib/ld-2.3.6.so), and tell the ldd script to use that version. It would probably be best to run the script with bash rather than FreeBSD's sh. I suspect there are bash-specific idioms in that script. I tried that and ld-2.3.6.so returns funky results (not surprising)... /tmp/ld-2.3.6.so --verify /compat/linux/bin/bash ; echo $? 1 On a real linux box: /lib/ld-2.3.6.so --verify /bin/bash ; echo status: $? 6 status: 0 To get /compat/linux/lib/ld-linux.so.2 (and thus /compat/linux/usr/bin/ldd) working in the emulated environment would probably take some hacking. I vaguely recall this being discussed before? To the OP, why not just use native FreeBSD ldd? ldd /compat/linux/bin/bash /compat/linux/bin/bash: libtermcap.so.2 => /lib/libtermcap.so.2 (0x28109000) libdl.so.2 => /lib/libdl.so.2 (0x2810e000) libc.so.6 => /lib/obsolete/linuxthreads/libc.so.6 (0x28112000) /lib/ld-linux.so.2 (0x280e9000)