Building powerpc (32-bit) packages on amd64

Daniel Benjamin Miller dbmiller at
Sat Nov 9 06:25:40 UTC 2019

While it's not normally supported, I have managed to build powerpc 
packages on amd64, for a 32-bit target. I recently obtained a PowerBook 
G4 and was interested in running FreeBSD on it. So I installed the base 
system, but found that there were no binaries out there. Somebody had an 
unofficial server in ~2015 but it looks like there's nothing on the web 
now. Compiling ports on a G4 is torturous, so I decided to give it a 
whirl on my amd64 computer. The issue was that I couldn't run powerpc 
(32-bit) FreeBSD in QEMU, and it seemed that cross-compiling using 
poudriere was not supported with a powerpc target from an amd64 host. 
I've been able to generate some packages using the following method:

1. Run a FreeBSD-CURRENT (powerpc64) virtual machine under Linux, using 
the command sudo qemu-system-ppc64 -M pseries-2.12-sxxm -smp 2 -mem-path 
/dev/hugepages -drive file=bsd.img -m 12G -boot c as my boot command. 
(Before this, you'll need to have a CD attached, of course, in order to 
install it.)

2. Compile pkg, then pkg install poudriere.

3. Add a simple poudriere.conf (I just went with the example).

4. Create poudriere's data folder.

5. poudriere ports -c

6. poudriere jail -c -j ppc32 -v 12.1-RELEASE -a powerpc

7. Create a file and then run poudriere bulk -f <myfile> -j ppc32

And it all seems to work. Once my job is done, I will post my unofficial 
binaries in a publicly accessible repository. I don't know if the 
project maintainers would be potentially interested in using this method 
to compile powerpc (32-bit) binaries on modern hardware (being that the 
userbase for this architecture is, in all likelihood, fairly small). 
Nevertheless, these packages should make my PowerBook G4 somewhat more 
useful as a FreeBSD system.

More information about the freebsd-ppc mailing list