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:

Current cross-toolchain repository

Add "deb http://people.dunnewind.net/arthur/sh4/cross/ ./" to your sources.list

Install gcc-4.1-sh4-linux-gnu libc6-dev-sh4-cross or whatever you want.

Build our own toolchain

binutils

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.

gcc

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...

glibc

Get libc6-dev-sh4-cross and all its deps on http://people.dunnewind.net/arthur/sh4/cross/

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

gcc

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