From owner-freebsd-amd64@FreeBSD.ORG Fri Nov 26 19:17:04 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F01C16A4CE for ; Fri, 26 Nov 2004 19:17:04 +0000 (GMT) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23EBD43D1F for ; Fri, 26 Nov 2004 19:17:04 +0000 (GMT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id ECEB72A8E0 for ; Fri, 26 Nov 2004 11:17:03 -0800 (PST) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id 7B82BE2B3 for ; Fri, 26 Nov 2004 11:17:03 -0800 (PST) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.13.1/8.13.1) with ESMTP id iAQJH3cq017533; Fri, 26 Nov 2004 11:17:03 -0800 (PST) (envelope-from peter@wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.13.1/8.13.1/Submit) id iAQJH2vv017532; Fri, 26 Nov 2004 11:17:02 -0800 (PST) (envelope-from peter@wemm.org) X-Authentication-Warning: overcee.wemm.org: peter set sender to peter@wemm.org using -f From: Peter Wemm To: freebsd-amd64@freebsd.org Date: Fri, 26 Nov 2004 11:17:02 -0800 User-Agent: KMail/1.7 References: <20041116052630.GD49800@manor.msen.com> <200411251242.33406.peter@wemm.org> <20041126184559.GJ49800@manor.msen.com> In-Reply-To: <20041126184559.GJ49800@manor.msen.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200411261117.02622.peter@wemm.org> Subject: Re: How to use older libs in 32bit mode? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2004 19:17:04 -0000 On Friday 26 November 2004 10:46 am, Michael R. Wayne wrote: > On Thu, Nov 25, 2004 at 12:42:33PM -0800, Peter Wemm wrote: > > Things to check: > > > > * Make sure you have COMPAT_IA32 in your kernel config. For > > example, this command should work: > > > > peter@overcee[8:16pm]~/fbp4/hammer/sys/amd64/conf-120> sysctl > > kern.elf32 kern.elf32.fallback_brand: -1 > > (The important thing is that it prints something, not the value) > > Yes: > > sysctl kern.elf32 > > kern.elf32.fallback_brand: -1 > > > * Make sure you have NOT copied ld-elf or libc from an i386 system. > > You *MUST* build at least these two on your machine. How to check: > > > > peter@overcee[8:17pm]~-123> strings /libexec/ld-elf32.so.1 | grep > > libmap32 /etc/libmap32.conf > > If this comes up empty, you're in trouble. Check that > > /usr/libexec/ld-elf32.so.1 and /libexec/ld-elf.so.1 are the same > > file. > > So far OK: > > strings /libexec/ld-elf32.so.1 | grep libmap32 > > /etc/libmap32.conf > and > lrwxr-xr-x 1 root wheel 22 Nov 15 17:13 > /usr/libexec/ld-elf32.so.1@ -> /libexec/ld-elf32.so.1 > > > These will not be present on a 5.3-release system. > > Running 5.3-RELEASE so they are not present, as expected. > > > Oh wait a second. Did you build your libraries with > > WITH_LIB32=yes or by running build32.sh ? I have a suspicion > > that build32.sh will produce a bad library now. > > Aha. Yes, I built with build32.sh as it was the only way I found to > do it. If this is not correct, perhaps someone could put up a > quick "how-to" page and post a URL? > > It would also be useful to understand how to build a port for i386, > google was not helpful in determining how to do this. > > > BTW: it is helpful to do a ktrace/kdump and show the last few > > lines. I suspect there will be a sysarch syscall, followed by a > > SIGSEGV. > > You are correct: > 72509 hello CALL sysarch(0x1,0xffffd70c) > 72509 hello RET sysarch -1 errno 22 Invalid argument > 72509 hello PSIG SIGSEGV SIG_DFL > 72509 hello NAMI "hello.core" > > So, it looks like build32.sh is broken on 5.3-RELEASE. What now? Oh no! It means that FreeBSD/i386 binaries unconditionally use TLS (thread-local-storage) setup calls in early startup. That means we are hosed until a bunch of TLS support routines are merged from 6.0 to 5.3-stable. Unfortunately, there is nothing that you can do for now. :-( -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5