How to set up a m68k-linux(-gnu) cross-compiler for building m68k kernel-images

The debian package toolchain-source is nice, but kegel.com/crosstool is even nicer, since it allows you not only to build a gcc-2.95 cross-compiler, which is still needed on m68k to compile 2.4 kernels, but it also allows you to have several gcc versions installed at the same time. See Dan Kegel's website for all about crosstool. If you just want to quickly build gcc-2.95 and gcc-3.3 to build m68k kernel-images, the following commands should work, provided you have wget installed, a homedir with some space, and /opt dir with even more space, and some time to build the toolchains:
 wget http://kegel.com/crosstool/crosstool-0.38.tar.gz
 tar xvfz crosstool-0.38.tar.gz
 cd crosstool-0.38
 wget http://people.debian.org/~cts/debian-m68k/cross-compile/build-m68k.sh
 sh build-m68k.sh
It seems gcc-2.95.4 is not available from gnu.org anymore, try this version:
 cd ~/downloads
 wget http://people.debian.org/~cts/debian-m68k/cross-compile/gcc-2.95.4.tar.bz2
After the build has finished (which it should with the config above), you can make the binaries available, either by adding the directories to the path, or by:
cd /usr/bin
sudo ln -s /opt/crosstool/gcc-2.95.3-glibc-2.2.2/m68k-linux/bin/m68k-linux-* .
sudo ln -s /opt/crosstool/gcc-3.3.6-glibc-2.3.5/m68k-linux-gnu/bin/m68k-linux-gnu-* .
sudo ln -s m68k-linux-gcc m68k-linux-gcc-2.95
sudo ln -s m68k-linux-gnu-gcc m68k-linux-gnu-gcc-3.3
The last two commands are necessary, since the 2.4 kernels are explictely built with gcc-2.95. In sarge, 2.6 kernels for m68k are built with gcc-3.3, which in etch is called m68k-linux-gnu-gcc (instead of m68k-linux-gcc previously). Then, you want to compile, ie linux-2.6.

Have fun,

Christian


This page is maintained by Christian T. Steigies. Sending spam mail to this address will be prosecuted.
Date: 2005/09/06