This is an old revision of the document!
FreeBSD hacking for ARM systems
Developing on the ARM system itself is just like developing FreeBSD for any system using the native tools. For example, to build userland on an ARM system you would just cd /usr/src ; make buildworld. Modern i386 and amd64 systems are often faster than the ARM systems we develop for, which makes cross-building an attractive option. This page focuses on the cross-build process.
How to Cross-Build
The FreeBSD build system includes support for cross-building. The only thing needed to start a cross-build instead of a native build is to add TARGET_ARCH= to the make command line, naming an architecture different than the build host. (Some architectures also require you to add TARGET= but doing so is optional for ARM architectures.) The TARGET_ARCH names available for ARM are:
| arm | ARMv4 and ARMv5 little-endian systems |
| armeb | ARMVv4 and ARMv5 big-endian systems |
| armv6 | ARMv6 and ARMv7 systems with software-compatible hardware floating point |
| armv6hf | ARMv6 and ARMv7 systems with native hardware floating point |
The armv6 architecture is being deprecated in favor of armv6hf, which gives better floating point performance.
When cross-building, the object files are placed into a separate subdirectory which includes arm.archname as the top level. For example, if you haven't overridden MAKEOBJDIRPREFIX, then the object files from make TARGET_ARCH=armv6hf buildworld will be in /usr/obj/arm.armv6hf/
It is important to consistantly specific TARGET_ARCH= on all make commands. If you make buildworld TARGET_ARCH=armv6hf and then make installworld DESTDIR=/mnt you will accidentally install the native archicture, not the armv6hf world you just built.