From owner-freebsd-amd64@FreeBSD.ORG Fri Dec 12 12:29:39 2008 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB871065672 for ; Fri, 12 Dec 2008 12:29:39 +0000 (UTC) (envelope-from gofda-freebsd-amd64@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id A78DB8FC2A for ; Fri, 12 Dec 2008 12:29:39 +0000 (UTC) (envelope-from gofda-freebsd-amd64@m.gmane.org) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1LB6v9-0002bN-J3 for freebsd-amd64@freebsd.org; Fri, 12 Dec 2008 12:15:03 +0000 Received: from firewall.andxor.it ([195.223.2.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Dec 2008 12:15:03 +0000 Received: from lapo by firewall.andxor.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Dec 2008 12:15:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-amd64@freebsd.org From: Lapo Luchini Date: Fri, 12 Dec 2008 13:00:41 +0100 Lines: 61 Message-ID: References: <32d8477c0612301410q2aaf9d39k859d242739554fd6@mail.gmail.com> <20061231003901.GA76688@slackbox.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: firewall.andxor.it User-Agent: Thunderbird 2.0.0.18 (X11/20081202) In-Reply-To: <20061231003901.GA76688@slackbox.xs4all.nl> X-Enigmail-Version: 0.95.7 OpenPGP: id=C8F252FB Sender: news X-Mailman-Approved-At: Fri, 12 Dec 2008 12:47:40 +0000 Subject: WINE in jail [Was: i386_set_ldt and wine on AMD64] X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 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, 12 Dec 2008 12:29:40 -0000 Roland Smith wrote: > On Sat, Dec 30, 2006 at 05:10:08PM -0500, Siavosh Benabbas wrote: >> Hi, >> I know that this is brought up several time on this list, but I wanted to >> run wine on my FreeBSD AMD64 machine. >> I know that a 64-bit wine is nearly impossible but I thought that an i386 >> compilation should work. > > You'd need a cross-compiler to start with. That's the easy part. > > Then you'd need ports infrastructure to compile 32-bit ports on amd64. Easiest approach to avoid that part seems to be seting up a full i386 jail inside the amd64 host, and install WINE normally from the ports. >From man jail(8): host# D=/here/is/the/jail host# cd /usr/src host# mkdir -p $D host# make world DESTDIR=$D host# make distribution DESTDIR=$D host# mount -t devfs devfs $D/dev But as suggested here I actually: host# make world distribution TARGET_ARCH=i386 TARGET=i386 DESTDIR=$D host# ln -s ld-elf.so.1 $D/libexec/ld-elf32.so.1 Then added IP alias for jail use, set up a unionfs over ports (to avoid having them double) and can correctly login in the jail: host# ifconfig em0 inet $IP/32 alias host# mount -t unionfs -o noatime,below /usr/ports $D/usr/ports host# jail $D $HOSTNAME $IP /bin/tcsh >From there I normally installed WINE: jail# cd /usr/ports/emulatos/wine jail# make install clean …but then it just “bus error” dumps on me… something to do with LDT: jail# winecfg Bus error (core dumped) jail# gdb `which wine-pthread` wine-pthread.core (gdb) bt #0 0x7df3b2e9 in wine_ldt_init_fs () from /usr/local/lib/libwine.so.1 #1 0x7bf00fb3 in init_pthread_functions () #2 0x7e36a81f in thread_init () from /usr/local/lib/wine/ntdll.dll.so #3 0x7e345d98 in __wine_process_init () from /usr/local/lib/wine/ntdll.dll.so #4 0x7df3bd74 in wine_init () from /usr/local/lib/libwine.so.1 #5 0x7df571eb in wine_casemap_upper () from /usr/local/lib/libwine.so.1 -- Lapo Luchini - http://lapo.it/ “Beware of bugs in the above code; I have only proved it correct, not tried it.” (Donald Knuth, 1977-03-22)