GrabDuck

Installing Emdebian ARM Cross Toolchain in Debian

:

I had previously installed Sourcery G++ ARM Linux toolchain in Ubuntu to build some software running in Debian, but I encountered some issues with some libraries (libavg) that use gethostbyname in static libraries without any easy way to make it dynamic. In that case, the library in the rootfs and cross-compiler must match.  So I decided to install Debian Squeeze (6.0.3) and the corresponding cross-toolchain by Emdebian (short for Embedded Debian).

First to use this toolchain, add the URL to get Emdebian packages to /etc/apt/sources.list:

#
# — Emdebian cross toolchains
#
deb http://www.emdebian.org/debian/ squeeze main

Then install Emdebian public key:

apt-get install emdebian-archive-keyring
apt-get update

If you don’t install the key, you’ll get the following error:

W: GPG error: http://www.emdebian.org squeeze Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY B5B7720097BB3B58

Search and install packages for the architecture that you need, in this case ‘armel’:

apt-cache search armel

This command will return a long list of armel packages.
Install the relevant package (you can check the version you want in the list returned above):

apt-get install linux-libc-dev-armel-cross
apt-get install libc6-armel-cross libc6-dev-armel-cross
apt-get install binutils-arm-linux-gnueabi
apt-get install gcc-4.4-arm-linux-gnueabi
apt-get install g++-4.4-arm-linux-gnueabi

The ARM toolchain is now installed:

 # arm-linux-gnueabi-gcc -v
Using built-in specs.
Target: arm-linux-gnueabi
Configured with: ../src/configure -v –with-pkgversion=’Debian 4.4.5-8′ –with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs –enable-languages=c,c++,fortran,objc,obj-c++ –prefix=/usr –program-suffix=-4.4 –enable-shared –enable-multiarch –enable-linker-build-id –with-system-zlib –libexecdir=/usr/lib –without-included-gettext –enable-threads=posix –with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.4.5 –libdir=/usr/lib –enable-nls –enable-clocale=gnu –enable-libstdcxx-debug –enable-objc-gc –disable-sjlj-exceptions –enable-checking=release –program-prefix=arm-linux-gnueabi- –includedir=/usr/arm-linux-gnueabi/include –build=i486-linux-gnu –host=i486-linux-gnu –target=arm-linux-gnueabi –with-headers=/usr/arm-linux-gnueabi/include –with-libs=/usr/arm-linux-gnueabi/lib
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)

If you need to install more pre-built ARMEL libraries, you’ll need to install xapt and dpkg-cross:

apt-get install pdebuild-cross dpkg-cross

Finally, to install an ARMEL library (e.g. libpng12-0), run xapt as follows:


Most of the instructions come from http://wiki.debian.org/EmdebianToolchain#Get_the_binaries for Debian Lenny.

Tweet I had previously installed Sourcery G++ ARM Linux toolchain in Ubuntu to build some software running in Debian, but I encountered some issues with some libraries (libavg) that use...