[maemo-developers] Cross compiling under debian

From: Guillem Jover guillem.jover at nokia.com
Date: Wed Apr 18 14:34:48 EEST 2007

On Wed, 2007-04-18 at 09:43:32 +0200, ext Sebastian Mancke wrote:
> So, at the moment I cross compile from my x86 debian, which seems to
> work fine except of the following problems with the debian packaging:
> 1. dh_strip -a (from x86) does not know, how to handle the arm binaries.
> (I have disabled it with: DEB_BUILD_OPTIONS=nostrip)

You need to install binutils-multiarch.

> 2. dh_shlibdeps does not work, because the ldd (from the toolchain)
> tries to use ld-linux.so.3 from my host instead from the rootstrap.
> /home/asteban/maemo/toolchain/scratchbox/compilers/arm-linux-2006q3-27/arm-none-linux-gnueabi/libc/usr/bin/ldd:
> line 166: /lib/ld-linux.so.3: No such file or directory

Neither dh_shlibdeps nor dpkg-shlibdeps should be using ldd on the latest
Debian versions. Also dpkg-shlibdeps needs access to the dpkg db, to
match sonames with package names, so this will not work yet. You could
fix some of the problems with -L, but you'll need dpkg svn's trunk to
get the new --admindir. But admindir is not propagated to the child dpkg,
this needs to be fixed in general so that child processes inherit the
admindir variables (I talked about this in a thread about sbox2).

> 3. dpkg-architecture does not know 'arml'
> It would be possible to hack a fix in the script, like the one in
> scratchbox:
> sub debian_arch_fix
> {
>     local ($os, $cpu) = @_;
>     ...
>     } elsif ("$os-$cpu" eq "gnueabi-linux-arm") {
>         return "armel";
>     ...
> }

It needs a bit more fixing than that, it's on the 1.14.0 roadmap.
Should be uploaded into unstable RSN.

> The problem 2. is my biggest one. Any suggestions? Cleaner solutions?

Either you wait, or you mess with the two scripts.

> My setup is as follows:
> TOOLCHAIN=~/maemo/toolchain/scratchbox
> ROOTSTRAP=~/maemo/toolchain/rootstrap
> export
> PATH=$TOOLCHAIN/compilers/arm-linux-2006q3-27/bin/:$TOOLCHAIN/compilers/arm-linux-2006q3-27/arm-none-linux-gnueabi/libc/usr/bin/:$PATH
> export CC=`which arm-none-linux-gnueabi-gcc`
> export LD=`which arm-none-linux-gnueabi-ld`
> export AR=`which arm-none-linux-gnueabi-ar`
> export PKG_CONFIG_PATH=$ROOTSTRAP/usr/lib/pkgconfig/
> alias pkg-config='pkg-config --define-variable=prefix=$ROOTSTRAP/usr'
> # no a nice soution
> export DEB_BUILD_OPTIONS=nostrip
> Then I simply run 'fakeroot dpkg-buildpackage -d'

Ideally you should be able to use -aarmel and get it working, but we
are not there yet.


More information about the maemo-developers mailing list