Cross compiling on AMD64 – the teaser

Cross compiling on AMD64 – the teaser

Cross compiling is the act of compiling for one platform (e.g. i386) when on another (e.g. AMD 64).
Why is this interesting to me? I have an AMD 64 3000+ with 1GB of RAM running on an
ASUS A8V Deluxe1.
It’s acting as my gateway right now. Needless to say, it is very under utilized.

Recently, I’ve been consolidating my machine room and getting rid of older, slower machines.
As a result, the services provided by these boxes have been moved onto faster boxes.
One of these services is building world. I don’t like building world on my laptop.
It’s slow and too much wear and tear on a laptop drive can’t be good for it. 😉

The solution, Build world on your fast box, install on your slow box
I’ve been doing that since early 2001, nearly 6 years. However, that was when everything I owned ran
the same version of FreeBSD. But now I have FreeBSD 4.11 and FreeBSD 6.0-RC1 running here. I might also
have FreeBSD 5.4 running soon (as a testing platform for the best backup solution.
I want my AMD 64 to run in amd64 mode, not i386. And I want it to build for all those targets.

1 – I erroneously reported my mainboard as an
when I first published this article. And, for what it’s worth, this machine is no longer my gateway.
– 29 December 2005

Solutions I thought about and discarded

When I first thought about this, I had a few bright ideas, all discarded.

multiple machines
Nope. I didn’t like this one. Too much to look after and I’d like to do
this all on one machine
I thought about multi-booting the system. Each time I wanted to build for 5.x, I’d
boot the system into 5.x, build, and then install. That would work. But it’s ugly.
I could only install for one version at a time, and builds would happen serially instead
of in parallel. It would also prevent me from running other services on the box, such
as a database server. I can’t be developing FreshPorts
with a database server that’s not up all the time.

I could install a jail under 6.0 and run 4.x or 5.x in that jail. That would work. But there
are overheads associated with a jail. It’s like having another machine to look after.
I could run a virtual machine on each box and run the appropriate OS within that machine and then
build from there. Sorry, but that’s too much like running jails and I already discarded that idea.
In addition, there was some question as to performance. Yes, I’m just building world here, but
I’d like to do it quickly.

So what solution did I choose?

I went with something very simple. It’s fast, it’s efficient, and it works. Well, it works so far.
I have managed to build world and a kernel. I have not tested the output, but the preliminary results
are very promising.

I hope to get to this final testing this weekend and have something more than just a teaser for you
next week.

1 thought on “Cross compiling on AMD64 – the teaser”

Leave a Comment

Scroll to Top