The toolchain is made up of several packages:

  • the kernel headers
  • the binutils package, that contains the assembler, the linker and binary handling tools
  • the glibc package, containing among other things the standard C library used by all programs
  • the gcc (Gnu Compiler Collection) package, at least to provide the C compiler

These packages are not easy to build, as they have cross-dependencies (best known as the "chicken and egg" problem ;-) ): in order to compile the C compiler, you need the C library, which in turn requires a C compiler to compile...

Fortunately, the way out of this devil's circle is to build an intermediate limited bootstrap compiler that do not require the full C library, build the C library, then rebuild the full C compiler itself.

As you can see, this is far from a trivial task, and it explains why this is still considered as a complex task.

One usefull tool if you wan to build your own cross-compiling toolchains is the crosstool project, which aims at creating a Shell script that does exactly that.

My only regret is that it is a monolithic Shell script: I would rather have a set of separate Makefile rules... Also, it does not take into consideration building a cross toolchain with the µClibc as a replacement for the (huge) GNU C library.