Objectives

Cross compiler, by definition, is a compiler which builds software for another platform, not the platform it is running on. For example, one may compile from Windows to Linux or Mac OS X; one may compile from x86 to ARM or x86_64.

For the purpose of this tutorial, we consider cross-compiler running on Win32, target platform is Raspberry Pi running GNU/Linux, target architecture/ABI is ARMv6 either with hardware floating-point support or without it. The reason for two distinct cross-compilers for Raspberry Pi is existence of two types of GNU/Linux distributions for Raspberry Pi:

  • GNU/Linux distributions with hardware floating point ABI (e.g. Raspbian Jessie)
  • GNU/Linux distributions without hardware floating point ABI (e.g. Debian Jessie)

We make C/C++ compiler only; Ada, Fortran and GNU Java are out of scope of this tutorial.

We want our cross-compiler to be fully built under Win32 and run in clean Win32 environment, without any special DLLs like cygwin1.dll or other dependencies (so host platform will be MinGW). But some components of cross-compiler can be built only on Cygwin host plaform (MinGW is not powerful enough for them), so we will intermix Cygwin with MinGW during our work.


>> Read next section or buy already prepared cross-compiler ($10) to save your time.