From owner-freebsd-emulation@FreeBSD.ORG Wed Mar 30 04:22:42 2005 Return-Path: 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 6DEAE16A4CF; Wed, 30 Mar 2005 04:22:42 +0000 (GMT) Received: from sophia3.e-shell.net (sophia3.e-shell.net [64.246.46.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C1EF43D53; Wed, 30 Mar 2005 04:22:42 +0000 (GMT) (envelope-from loox@e-shell.net) Received: from dsl-200-95-2-41.prod-infinitum.com.mx (dsl-200-95-2-41.prod-infinitum.com.mx [200.95.2.41]) by sophia3.e-shell.net (Postfix) with ESMTP id 6929A656836; Tue, 29 Mar 2005 22:22:41 -0600 (CST) From: Axel Gonzalez To: freebsd-amd64@freebsd.org Date: Tue, 29 Mar 2005 22:22:39 -0600 User-Agent: KMail/1.8 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503292222.39751.loox@e-shell.net> cc: Michael Hopkins cc: freebsd-emulation@freebsd.org Subject: Re: Cross-compiling/porting to Linux X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 30 Mar 2005 04:22:42 -0000 On Tuesday 29 March 2005 05:32, Michael Hopkins wrote: > Hi all > > I have just installed mingwin32 from the ports and it works beautifully - > can now port all my Unix command line code (including linking to win32 > libraries) to win32 with the flick of a make switch. Marvellous! Glad to know it works now.. I should have checked more often > > Now to linux... I haven't tried any of the linux compatibility stuff yet, > either for running binaries or cross-compiling. I thought I would ask here > first because I have seen quite a few messages suggesting potential issues > on amd64. > > At the moment I am mainly interested in cross-compiling and wanting to > target 32-bit linux, but obviously 64-bit will be useful in the future. > Would like to get some advice on what to install and any kernel > configuration or module loading that I might need to do. This should be well documented elsewhere, if i remember correctly: on kernel, add the options: options LINPROCFS options COMPAT_43 options COMPAT_LINUX32 Install the emulators/linux_base-8 port and enable on rc.conf linux_enable="YES" After that you should have a running linux enviroment $ /compat/linux/bin/bash $ uname -a Linux moonlight 2.4.2 FreeBSD 5.3-STABLE #0: Thu Feb 3 23:08:02 CST 2005 amd64 amd64 amd64 GNU/Linux Then, the real thing, the cross compile NOTE: At this point I'm guessing, tell us if it works ;) Get a GCC RPM and install it (check the Makefile on the linux port, to see the flags it uses, and see you dont overwrite system GCC) Maybe some extra RPMs.. make, libtool etc Run gcc from the linux bash (check the path to be sure its really using linux's gcc) *IF* this work, you should be able to compile and run linux32 programs (you using a linux compiler right ?) For linux64, well first step is to get binaries working