cross platform building under emulation

Doug Ambrisko ambrisko at ambrisko.com
Tue Oct 18 11:47:24 PDT 2005


Dan Langille writes:
| On 18 Oct 2005 at 11:22, Doug Ambrisko wrote:
| > Kris Kennaway writes:
| > | On Fri, Oct 14, 2005 at 07:27:00PM -0700, Doug Ambrisko wrote:
| > | > Dan Langille writes:
| > | > | Daris has got me thinking about unpacking 4.9-release/bin into a 
| > | > | directory, and then doing a chroot.
| > | > 
| > | > That sort-of works.  I've done some setups for companies and get
| > | > iteratively better solutions. 
| 
| Can you elaborate please upon the "sort-of-works".  I haven't seen 
| anything that indicates this.  Thanks.

I think you are pretty safe doing a "make world".  When you start
building things that use autoconf, libtool etc. that probe the OS
then things start to fail.  Sometimes it works by accident.
pkg_add for example will add versions based on the kernel via libc.
Building Postgress will fail.  You'll also notice that building
some things will say "freebsd6" in the "configuration instead of
the real target since it picks up the "uname" via the kernel using
libc's uname and not /bin/uname.

If you need things like mount, ps etc in your build script they won't
work so you need some helper binaries and it needs to pull in the
correct libexec & libs which gets tricky if your host is amd64 and
your are building for i386 since you get name space conflicts.
I used a sed script to "binary" edit the host's binaries to use
a different directory.  As long as you don't change the length of
strings your okay.  Here's an example:
	sed -e 's/libkvm/libhvm/g' -e 's/libexec/libhxec/g' \
		-e 's/libsbuf/libhbuf/g'

So it depends on how clean of a solution you want.  With the things
I've done I can do a complete build of FreeBSD and ports with it
thinking it whatever version the target is.

Somethings are close enough they work by accident.  I mainly ran
into trouble building Postgress for FreeBSD 4.10 on a FreeBSD amd64 host.
I need this since I want one build machine to be able to build all of
our SW releases using whatever version of FreeBSD it was shipped with.
Also I could speed up builds by using a 4G MFS for the build directory
using amd64!

Doug A.


More information about the freebsd-emulation mailing list