Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Mar 2005 20:34:44 +0200
From:      Ulrik Guenther <ulrik@00t.org>
To:        Michael Hopkins <michael.hopkins@hopkins-research.com>
Cc:        "freebsd-amd64@freebsd.org" <freebsd-amd64@freebsd.org>
Subject:   Re: Cross-compiling/porting to Linux
Message-ID:  <424AF144.2060503@00t.org>
In-Reply-To: <BE704E82.36B2F%michael.hopkins@hopkins-research.com>
References:  <BE704E82.36B2F%michael.hopkins@hopkins-research.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Heya!

For me the redhat packages did not work as I wanted them to work.
Maybe you should give the following tutorial a try:

	http://people.freebsd.org/~tjr/linux32.html

There it is explained how to get the Linux32 emulation running with
Slackware 10 as base (10.1 might work as well). With Slackware you
will not have to mess around with creepy tools like RPM. And of course,
on the Slackware mirrors you will also find pre-packaged versions of the
GCC. By the way, if you still want to use RPMs, try to use the switches
- --ignoreos, --ignorearch and --nodeps, these ones worked for me when
installing OOo 2.0 beta.
Hope I helped :)

Have a nice day,

Ulrik Guenther

Michael Hopkins wrote:
| On 30/3/05 5:22 am, "Axel Gonzalez" <loox@e-shell.net> wrote:
|
|
|>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
|>
|
| Hi Axel
|
| Seems to work well but not tested exhaustively across different code and
| Windows versions yet.
|
|
|>>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
|>
|
| 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
|
|
|>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)
|>
|
| This is where I got badly stuck, though I might have the answer - see
below.
|
| 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ąt
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 >= 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
standard
| 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 to
| go?  I will investigate further and let you know.
|
|
|>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)
|>
|
|
| Will try these later today.
|
|
|>*IF* this work, you should be able to compile and run linux32 programs
(you
|>using a linux compiler right ?)
|>
|
|
| So I can't get to these steps until I have worked out how to install
the GCC
| 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
| ===>  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
|>
|
| 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'
|
|
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
|
| _______________________________________________
| freebsd-amd64@freebsd.org mailing list
| http://lists.freebsd.org/mailman/listinfo/freebsd-amd64
| To unsubscribe, send any mail to "freebsd-amd64-unsubscribe@freebsd.org"
|

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCSvFEy06DkvPH780RAo/eAJwPYUdswhVwX1+eAw9UWq82kBmZWQCgoZdZ
dwwjNDwP+/FxC/6V8Ve1Csc=
=VHf7
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?424AF144.2060503>