Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jun 2014 12:01:13 -0700
From:      Tim Kientzle <tim@kientzle.com>
To:        Stepan Dyatkovskiy <stpworld@narod.ru>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Compilation for ARM
Message-ID:  <6D7645D2-9C08-4B5D-BAA5-5B6EC8F66F0B@kientzle.com>
In-Reply-To: <53935D02.2030604@narod.ru>
References:  <53935D02.2030604@narod.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 7, 2014, at 11:42 AM, Stepan Dyatkovskiy <stpworld@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6D7645D2-9C08-4B5D-BAA5-5B6EC8F66F0B>