Building for ARM

From Egbert's Wiki

Introduction

Short list of steps to install the armv5te toolchain on Ubuntu Linux 12.10.

Download iso's

Get the iso of the Embedded Linux Development Kit (ELDK). The Elektor Project uses the v5.0. 5.2.1 and 5.3 are latest.

wget ftp://ftp.denx.de/pub/eldk/5.0/iso/armv5te-qte-5.0.iso
wget ftp://ftp.denx.de/pub/eldk/5.2.1/iso/eldk-5.2.1-armv5te.iso
wget ftp://ftp.denx.de/pub/eldk/5.3/iso/eldk-5.3-armv5te.iso

See the ELDK wiki.

mount iso and install toolchain

cd /media
mkdir eldk-iso 
mount -o loop /tmp/armv5te-qte-5.0.iso /media/eldk-iso
cd eldk-iso
./install.sh -s -i qte armv5te
cd ..
umount /media/eldk-iso
rmdir eldk-iso

The toolchain is now installed in /opt/eldk-5.0/

Environment

Add the following to a file called set.sh or to .bashrc.

P1=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/usr/bin/armv5te-linux-gnueabi/
P2=/opt/eldk-5.0/armv5te/sysroots/i686-oesdk-linux/bin/armv5te-linux-gnueabi/

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
export PATH=$P1:$P2:$PATH

Eldk-switch

When more versions are installed in parallel, use the eldk-switch tool. See ELDK wiki. This tool can be downloaded from git:

$ git clone git://git.denx.de/eldk-switch.git
$ cd eldk-switch
$ sudo make install

Add a shell-function to ~/.bash_profile:

eldk-switch () 
{ 
    eval `eldk-switch.sh $*`
}
export -f eldk-swtich

Use eldk-switch -m -r [5.0|5.2.1|5.3] to switch releases. Use eldk-switch -q to see the current selected release. Option -l lists the available releases.