From owner-freebsd-chat@FreeBSD.ORG Sat May 10 11:50:36 2008 Return-Path: Delivered-To: freebsd-chat@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F35A61065670 for ; Sat, 10 May 2008 11:50:36 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 63A7E8FC1C for ; Sat, 10 May 2008 11:50:36 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id m4ABoX8a018344; Sat, 10 May 2008 13:50:34 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id m4ABoWtA018343; Sat, 10 May 2008 13:50:32 +0200 (CEST) (envelope-from olli) Date: Sat, 10 May 2008 13:50:32 +0200 (CEST) Message-Id: <200805101150.m4ABoWtA018343@lurza.secnetix.de> From: Oliver Fromme To: freebsd-chat@FreeBSD.ORG, davids@webmaster.com In-Reply-To: X-Newsgroups: list.freebsd-chat User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Sat, 10 May 2008 13:50:35 +0200 (CEST) Cc: Subject: Re: Building 32-bit binaries on 64-bit 6.3 X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-chat@FreeBSD.ORG, davids@webmaster.com List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2008 11:50:37 -0000 David Schwartz wrote: > I've been looking for a way to build 32-bit x86 binaries on an AMD64 > install of FreeBSD 6.3 STABLE. Doing it within a 32bit chroot (or jail) is probably the easiest way. At least it was for me. I simply took a 32bit install from an FTP mirror, installed it into /usr/i386, mounted devfs inside it (and mdfs on tmp), then chrooted into it, and everything worked as expected. Of course, if you have a 32bit world on some other box, you can simply make a copy of it for your chroot. Of course, be sure that your amd64 kernel contains the line "options COMPAT_IA32" (it's in GENERIC by default), so the i386 binary compatibility is enabled. You also have to make a link inside the chroot's /libexec: # cd libexec # ln ld-elf.so.1 ld-elf32.so.1 And finally, certain Makefiles (including our buildworld target) will be confused and think that you're attempting to cross-compile. In order to trick them into assuming that you're running on a 32bit kernel, you have to set these environment variables before: # export UNAME_m=i386 # export UNAME_p=i386 If you're using csh or tcsh, use this syntax instead: % setenv UNAME_m i386 % setenv UNAME_p i386 With the above settings, I was able to perform a full buildworld + installworld within a 32bit chroot on a 64bit host. The result was still a 32bit world, of course. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell