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

Daisuke Aoyama aoyama at peach.ne.jp
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 
r244663.
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:

http://www.peach.ne.jp/archives/rpi/
(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:
http://www.peach.ne.jp/archives/rpi/config/RPI-B-test9

Source(diff) and pacth is here:
http://www.peach.ne.jp/archives/rpi/patch/


For more, please read this:
http://lists.freebsd.org/pipermail/freebsd-arm/2012-December/004331.html

tested /etc/make.conf:
----------------------------------------------------------------------
WITHOUT_X11=yes
WITH_CLANG=yes
WITH_CLANG_IS_CC=yes

# For clang
NO_WERROR=
WERROR=

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 
http://www.peach.ne.jp/archives/rpi/patch/src-244663-20121225.patch.gz
# fetch -o /usr/src/sys/arm/conf 
http://www.peach.ne.jp/archives/rpi/config/RPI-B-test9
# 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