Getting a Cross Compiler on Debian, the easy way

It's not exactly point and click, but it does work, eventually. This talks about ia64, substitute your target architecture.

  1. apt-get source binutils : Note that you need binutils 2.16.1cvs20060413-1 or later, or otherwise apply patch from Debian bug 231707

  2. Build with TARGET=ia64 fakeroot debian/rules binary-cross.

  3. Install the result .deb files.

  4. apt-get source gcc-4.2 and run GCC_TARGET=ia64 ./debian/rules control. Prepend with DEB_CROSS_INDEPENDENT=yes if you don't want your package to depend on the system base gcc package (if you do depend on it, when you upgrade your system's gcc you will need to update your cross compilers too).

  5. Now have a look at debian/control and take note of the packges with -ia64-cross. You need to make these with dpkg-cross. Download the packages from the archive and run dpkg-cross -a ia64 -b package.deb. I have a script get-from-pool.py which can help you download the packages. Install the converted files.

  6. Try building gcc with GCC_TARGET=ia64 dpkg-buildpackage -rfakeroot. It will tell you if there are any missing dependencies.

  7. Build should complete, use dpkg -i *.deb and you should have ia64-linux-gnu-blah tools.

Extra packages you'll probably need

libunwind7 libunwind7-dev libc6.1 libc6.1-dev linux-kernel-headers

IA64wiki: DebianCrossCompiler (last edited 2009-12-10 03:13:56 by localhost)

Gelato@UNSW is sponsored by
the University of New South Wales National ICT Australia The Gelato Federation Hewlett-Packard Company Australian Research Council
Please contact us with any questions or comments.