Compilation for ARM
Tim Kientzle
tim at kientzle.com
Sat Jun 7 19:01:22 UTC 2014
On Jun 7, 2014, at 11:42 AM, Stepan Dyatkovskiy <stpworld at narod.ru> wrote:
> I'm trying to cross-compile FreeBSD kernel with clang for ARM,...
For what board? There are a few high-level tools now for
building ready-to-run system images for particular boards.
> As base I used this guide:
> http://people.freebsd.org/~cognet/arm.html
That looks pretty old; there are much simpler approaches available now.
The basic process for cross-building is:
$ make TARGET_ARCH=armv6 buildworld
$ make TARGET_ARCH=armv6 KERNCONF=XYZ buildkernel
In particular, buildworld builds all of the cross-compile tools for you.
Also, clang is the default for FreeBSD on ARM now, so the above
commands all use clang.
If you want to do kernel development (which involves repeatedly
making changes and rebuilding), you'll want to experiment with
$ make TARGET_ARCH=armv6 buildenv
This starts a shell with all the necessary environment variables
already correctly set for cross-buildling. (It assumes you have
already done a cross-buildworld to build the tools.)
Note: For some targets, you need to also specify TARGET_CPUTYPE.
Cheers,
Tim
More information about the freebsd-arm
mailing list