cross platform building under emulation

Dan Langille dan at langille.org
Tue Oct 18 12:26:16 PDT 2005


On 18 Oct 2005 at 11:47, Doug Ambrisko wrote:

> 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!

I have two goals: faster builds, and consolidation of resources.  I 
don't want to maintain N machines to build for N environments.  
Creating N jails means less machines, but also more processes.  By 
taking the unpack and chroot solution, I think it's pretty simple, 
straight forward, easy to document, and therefore to implement.

I'm asking these questions now because I'm about to implement this at 
home and document it on http://www.freebsddiary.org/ (see the teaser 
at http://www.freebsddiary.org/cross-compiling-teaser.php).  My main 
concern is I don't want to be misleading people or giving them a 
build that contains real problems.  My test installs have resulted in 
a box that runs, but more information is always useful.

Thanks.
-- 
Dan Langille : http://www.langille.org/
BSDCan - The Technical BSD Conference - http://www.bsdcan.org/




More information about the freebsd-emulation mailing list