Cross Platform Port Builds

Jens Rehsack rehsack at
Sat Nov 10 06:06:03 PST 2007

Hi all,

I'm going to update my machines and run into a serious problem (for me ^^): Some ports fail to cross build and I fail to setup a sane environment.

At first, I created a chroot: /usr/room/$target. Into this chroot, I installed a host world using make installworld DESTDIR=/usr/room/$target/.
After that, I created /usr/room/$target/usr/src and /usr/room/$target/usr/ports and mounted /usr/src and /usr/ports to there, respectively. Sure I'd mounted a devfs to /usr/room/$target/dev/.

Then I's chrooted to /usr/room/$target/ and change the make.conf as needed for target machine and did make buildworld/buildkernel in /usr/src in the chroot.
That worked really fine.

But on the target machine not only a FreeBSD base distribution runs, there is a samba, xinetd, ftpproxy and squid also doing some work.
So I needed to cross-build those ports, too. I couldn't find a standardized way to do this, so I first created 2 start scripts:

waldorf# cat ~/bin/portcross 
env ARCH=i386 TARGET_CPUTPE= CPUTYPE=pentiumpro PATH=/usr/obj/i386/usr/src/tmp/usr/bin/:$PATH "$@"

waldorf# cat ~/bin/porthost 
env CPUTYPE=nocona "$@"

portcross I use to make/portupgrade a crossbuild (e.g. squid), porthost to build tools like autoconf. Now I run into problems (as the more expertized may imagine):
autoconf needs gettext, samba needs gettext. But the amd64-native auto-tools binaries can't load the ia32 gettext library - and I don't know how to hold them both without running into conflicts.
Furthermore perl seems to be resistant against crossbuild by specifying ARCH=i386 make build and above listed portcross. Any idea how to crossbuild perl?

Thanks in advance,

More information about the freebsd-questions mailing list