beaglebone

Mark Tinguely marktinguely at gmail.com
Tue Apr 17 19:34:51 UTC 2012


On Tue, Apr 17, 2012 at 1:00 PM, Alex T. <dioxinu at gmail.com> wrote:
> Just a quick question. What compiler do you use? When I start the kernel
> compilation the gcc from my base system is used, which is gcc 4.2.1, and it
> complains about armv6 target cpu:
>
> `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
> cc1: error: unrecognized command line option "-mlittle-endian"
> sys/arm/arm/genassym.c:1: error: bad value (armv6) for -march= switch
> sys/arm/arm/genassym.c:1: error: bad value (armv6) for -mtune= switch
>
> Do you override CC by any chance?
> Thanks.
>
>
> On 17 April 2012 14:25, Damjan Marion <dmarion at freebsd.org> wrote:
>
>>
>> I put together guide how to build bootable SD card with FreeBSD on
>> beaglebone.
>>
>> http://people.freebsd.org/~dmarion/beaglebone/creating_bootable_sd_card/
>>
>> It is still work in progress, so ethernet driver is not complete and USB
>> support is missing.
>>
>> Will be happy to hear any feedback.
>>
>> Damjan
>>
>> _______________________________________________

This should be somewhere in the FreeBSD ARM pages:

First, create the following directories into the destination directory :
mkdir -p usr/bin
mdkir -p usr/lib
mkdir -p usr/include
mkdir -p usr/share/man/man1
mkdir -p usr/share/info
mkdir -p usr/libdata/ldscripts
mkdir -p usr/libexec

go in /usr/src/gnu/usr.bin/cc, and do :

make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross clean depend all
make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross DESTDIR=/usr/cross install

Then go in /usr/src/gnu/usr.bin/binutils, and do :

make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross clean depend all
make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross DESTDIR=/usr/cross install

You should get what is needed to cross-compile a kernel.
You need to set the following environment varibles for cross-compiling :

export CC=/usr/cross/usr/bin/gcc
export AS=/usr/cross/usr/bin/as
export NM=/usr/cross/usr/bin/nm
export RANLIB=/usr/cross/usr/bin/ranlib
export LD=/usr/cross/usr/bin/ld
export OBJCOPY=/usr/cross/usr/bin/objcopy
export SIZE=/usr/cross/usr/bin/size
export MACHINE=arm
export MACHINE_ARCH=arm

 I add:

export PATH=/usr/cross/usr/bin:$PATH:

If you are doing a buildworld, do not use a cross compiler and only specify:

make TARGET_ARCH=arm buildworld
make TARGET_ARCH=arm DESTDIR=/path/to/arm/root installworld


More information about the freebsd-arm mailing list