Re: cross-compiling Debian packages
Eric Cooper wrote:
Also, would you welcome patches that add the ability to handle
packages built with alternative libc implementations, namely uClibc,
Dietlibc and Newlib? Shall I file a "bug" report?
In the meantime, can you make these available somewhere? (I'm
interested in using dpkg-cross for a cross-gcc + uclibc toolchain.)
OK. Here is the stuff I've been playing with.
A. For starters, you need to setup Debian-based GNU Libc based
cross-toolchain for your
architecture(s). This includes, in this order:
I found this step to be the easiest. If you need more info, ask
He has some pre-compiled binaries of those packages somewhere.
Note the linux-kernel-headers, binutils and gcc are required to be
building the uClibc package.
B. Update your dpkg. This patch
is needed to teach dpkg-architecture to allow for Debian architectures
X-Y. I used i386-uclibc, arm-uclibc and mipsel-uclibc. Feel free to add
additional ones to debian/archtable and ostable.
C. Update your dpkg-cross. This patch
is needed to teach dpkg-cross about existence of lib/debug, lib/diet/lib
lib/newlib and Debian architecures named X-Y (needed for uClibc). Feel free
to add more to the lists in dpkg-cross.pl.
D. Compile uClibc. Unfortunately, uClibc package is not designed for
a complete Debian distribution, so I had to modify it extensively with
Compiling this package with just a 'dpkg-buildpackage -ai386-uclibc'
should give you a
workable set of .debs that you can 'dpkg-cross -ai386-uclibc' after
which you get a
/usr/i486-linux-uclibc, just as you get /usr/i486-linux-gnu with glibc.
You also get
uclibc-toolchain package with gcc wrappers.
Note: during compilation you will get errors that i486-linux-uclibc-gcc
can not be found.
You can just do this somewhere in the $PATH:
$ for x in ar as cpp g++ gcc ld nm ranlib readelf size strings strip; do\
ln -s /usr/bin/i486-linux-gnu-$x i486-linux-uclibc-$x\
E. Voila! If you want to just try how it all works, point your apt at
http://www.xs4all.nl/~kurzanov/debian/ and install the versions of
dpkg, dpkg-cross, libuclibc0, libuclibc-dev,
can be found there.