From owner-freebsd-amd64@FreeBSD.ORG Wed Mar 30 11:39:46 2005 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 64D5916A4CE; Wed, 30 Mar 2005 11:39:46 +0000 (GMT) Received: from neon.webfusion.co.uk (neon.webfusion.co.uk [212.67.202.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FC2943D55; Wed, 30 Mar 2005 11:39:45 +0000 (GMT) (envelope-from michael.hopkins@hopkins-research.com) Received: from 83-216-132-201.markch725.adsl.metronet.co.uk ([83.216.132.201] helo=[192.168.0.5]) by neon.webfusion.co.uk with asmtp (Exim 3.36 #1) id 1DGbXt-0003Sx-00; Wed, 30 Mar 2005 12:39:37 +0100 User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Wed, 30 Mar 2005 12:39:30 +0100 From: Michael Hopkins To: Axel Gonzalez , "freebsd-amd64@freebsd.org" Message-ID: In-Reply-To: <200503292222.39751.loox@e-shell.net> Mime-version: 1.0 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: quoted-printable cc: freebsd-emulation@freebsd.org Subject: Re: Cross-compiling/porting to Linux 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: Wed, 30 Mar 2005 11:39:46 -0000 On 30/3/05 5:22 am, "Axel Gonzalez" wrote: > On Tuesday 29 March 2005 05:32, Michael Hopkins wrote: >> Hi all >>=20 >> 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! >=20 > Glad to know it works now.. I should have checked more often >=20 Hi Axel Seems to work well but not tested exhaustively across different code and Windows versions yet. >>=20 >> Now to linux... I haven't tried any of the linux compatibility stuff ye= t, >> either for running binaries or cross-compiling. I thought I would ask h= ere >> first because I have seen quite a few messages suggesting potential issu= es >> on amd64. >>=20 >> 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. >=20 > This should be well documented elsewhere, if i remember correctly: >=20 > on kernel, add the options: >=20 > options LINPROCFS > options COMPAT_43 > options COMPAT_LINUX32 >=20 > Install the emulators/linux_base-8 port >=20 > and enable on rc.conf >=20 > linux_enable=3D"YES" >=20 > After that you should have a running linux enviroment >=20 > $ /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 >=20 Did exactly these steps and got this far at 4:30am this morning! :o} root@Athlon ~ # cd /compat/linux/bin root@Athlon /compat/linux/bin # ./uname -a Linux Athlon 2.4.2 FreeBSD 5.3-RELEASE-p5 #2: Wed Mar 30 01:46:52 BST 2005 amd64 amd64 amd64 GNU/Linux >=20 > Then, the real thing, the cross compile >=20 > NOTE: At this point I'm guessing, tell us if it works ;) >=20 > Get a GCC RPM and install it (check the Makefile on the linux port, to se= e the > flags it uses, and see you dont overwrite system GCC) >=20 This is where I got badly stuck, though I might have the answer - see below= . =20 I first tried about 10 RPMs from various places that are meant to be for Redhat 8 on i386 (or i586 or i686 - I am guessing it shouldn=B9t matter?) and whenever I try to install them with the recommended command, e.g. : rpm -i --ignoreos --root /compat/linux --dbpath /var/lib/rpm /mnt/Desktop/apt-0.5.5cnc6-fr0.rh80.1.i386.rpm I get this message: "package apt-0.5.5cnc6-fr0.rh80.1 is for a different architecture" I then thought that the recently-installed linux rpm might be the right way to deal with this, so: /compat/linux/bin/rpm -i --ignoreos --root /compat/linux --dbpath /var/lib/rpm /mnt/Desktop/apt-0.5.5cnc6-fr0.rh80.1.i386.rpm warning: /mnt/Desktop/apt-0.5.5cnc6-fr0.rh80.1.i386.rpm: V3 DSA signature: NOKEY, key ID e42d547b error: Failed dependencies: rpm >=3D 4.0.0 is needed by apt-0.5.5cnc6-fr0.rh80.1 libstdc++ is needed by apt-0.5.5cnc6-fr0.rh80.1 /sbin/ldconfig is needed by apt-0.5.5cnc6-fr0.rh80.1 /bin/sh is needed by apt-0.5.5cnc6-fr0.rh80.1 libbz2.so.1 is needed by apt-0.5.5cnc6-fr0.rh80.1 libc.so.6 is needed by apt-0.5.5cnc6-fr0.rh80.1 libc.so.6(GLIBC_2.0) is needed by apt-0.5.5cnc6-fr0.rh80.1 libc.so.6(GLIBC_2.1) is needed by apt-0.5.5cnc6-fr0.rh80.1 libc.so.6(GLIBC_2.1.3) is needed by apt-0.5.5cnc6-fr0.rh80.1 libc.so.6(GLIBC_2.2) is needed by apt-0.5.5cnc6-fr0.rh80.1 libc.so.6(GLIBC_2.2.3) is needed by apt-0.5.5cnc6-fr0.rh80.1 libc.so.6(GLIBC_2.3) is needed by apt-0.5.5cnc6-fr0.rh80.1 libelf.so.0 is needed by apt-0.5.5cnc6-fr0.rh80.1 libgcc_s.so.1 is needed by apt-0.5.5cnc6-fr0.rh80.1 libgcc_s.so.1(GCC_3.0) is needed by apt-0.5.5cnc6-fr0.rh80.1 libm.so.6 is needed by apt-0.5.5cnc6-fr0.rh80.1 libncurses.so.5 is needed by apt-0.5.5cnc6-fr0.rh80.1 libpopt.so.0 is needed by apt-0.5.5cnc6-fr0.rh80.1 libpthread.so.0 is needed by apt-0.5.5cnc6-fr0.rh80.1 libpthread.so.0(GLIBC_2.0) is needed by apt-0.5.5cnc6-fr0.rh80.1 libpthread.so.0(GLIBC_2.1) is needed by apt-0.5.5cnc6-fr0.rh80.1 libreadline.so.4 is needed by apt-0.5.5cnc6-fr0.rh80.1 librpm-4.1.so is needed by apt-0.5.5cnc6-fr0.rh80.1 librpmdb-4.1.so is needed by apt-0.5.5cnc6-fr0.rh80.1 librpmio-4.1.so is needed by apt-0.5.5cnc6-fr0.rh80.1 librt.so.1 is needed by apt-0.5.5cnc6-fr0.rh80.1 libstdc++.so.5 is needed by apt-0.5.5cnc6-fr0.rh80.1 libstdc++.so.5(GLIBCPP_3.2) is needed by apt-0.5.5cnc6-fr0.rh80.1 libz.so.1 is needed by apt-0.5.5cnc6-fr0.rh80.1 Even though all of these executables and libraries are installed as standar= d in linux_base-8. Then another thought; use '--ignorearch' with the FreeBSD rpm command. This seems to install linux apt as required! :o) Maybe this is the right way t= o go? I will investigate further and let you know. > Maybe some extra RPMs.. make, libtool etc >=20 > Run gcc from the linux bash (check the path to be sure its really using > linux's gcc) >=20 Will try these later today. > *IF* this work, you should be able to compile and run linux32 programs (y= ou > using a linux compiler right ?) >=20 So I can't get to these steps until I have worked out how to install the GC= C tools for linux. As far as I can tell I have the following options: 1) Work out how to make RPMs work as discussed above. Would like this anyway to be able to use more linux stuff. 2) Install linux_devtools from ports - but: /usr/ports/devel/linux_devtools % make =3D=3D=3D> linux_devtools-8.0_3 is only for i386, and you are running amd64. 3) Find a tarball of the GCC toolset for RH8 i*86 and extract it into /compat/linux 4) ? Any others ? > For linux64, well first step is to get binaries working >=20 I will just be happy to have 32-bit working for now! Thanks for the input Michael _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_= / _/ _/ _/_/_/ Hopkins Research Ltd _/ _/ _/ _/ _/_/_/_/ _/_/_/ http://www.hopkins-research.com/ _/ _/ _/ _/ _/ _/ _/ _/ 'touch the future' =20 _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_= /