FreeBSD/armv6z/clang on Raspberry Pi 512MB (with U-Boot + ubldr)

Daisuke Aoyama aoyama at
Tue Dec 25 00:44:30 UTC 2012

I've updated FreeBSD clang world for RPI based on svn r244663.
(To save working time, drop EABI patch.)

Now clang is 3.2 final. This version includes complete source tree of 
But the patch is not applied. You must apply the patch manually.
This version has been confirmed that the kernel can be compiled by self and 
booting from it.

You can get the pre-build image from my archives:
(At this time, freebsd-pi-clang-20121225.img.gz is the latest version.)

Download and decompress it, then write it to SD. This image requires SD 4GB 
or more.
I'm using as headless server. So, you need a serial console for seeing the 
boot log.
If you need to change the value on it, please mount the second partition 
(e.g. /dev/da0s2a).
If you want the video out, please remove the line of "set 
console=comconsole" in /boot/loader.rc.

Using config is here:

Source(diff) and pacth is here:

For more, please read this:

tested /etc/make.conf:

# For clang

CFLAGS=-O2 -fno-strict-aliasing -pipe -march=armv6z -mtune=arm1176jzf-s -mfloat-abi=soft
COPTFLAGS=-O1 -fno-strict-aliasing -pipe -march=armv6z -mtune=arm1176jzf-s -mfloat-abi=soft
How to build the kernel in RPI:

# fetch -o /usr
# fetch -o /usr/src/sys/arm/conf
# cd /usr/src
# gzcat /usr/src-244663-20121225.patch.gz | patch
# make buildkernel KERNCONF=RPI-B-test9

(wait about 60 minutes :)

If you want re-compile, you can try to use like this:

# make buildkernel KERNCONF=RPI-B-test9 -DNO_CLEAN -DNO_CLEANDIR

Enjoy clang world in Raspberry Pi!
Thank you.
Daisuke Aoyama

More information about the freebsd-arm mailing list