SH4 Cross Toolchain howto

The goal is to setup a cross compiler to build glibc and then cross-compilong the sh4 native toolchain.

First, you must understant what does host, build and target correspond to:

Now let's build that.


Get the binutils sources:

Go to the source dir:

Binutils packaging system already have all the targets you'll need to build an _i386_ binutils for _sh4_ targets, just run:

You'll get a wonderful "binutils-sh4-linux-gnu_2.18-1_i386.deb", install it.


Since there already are some built glibc for sh4, we are going to install them instead of bootstrapping a minimal cross-compiler just to build the glibc and rebuild a full cross-compiler then...


Get libc6-dev-sh4-cross and all its deps on ./

The package is already dpkg-cross'ed, just install it.


As for binutils, there already are cross targets in the packaging, run: