Under a cross-compiler is defined as a compiler that runs (also called host platform ) on a particular system, but generates compiled files ( object files or executables ) for other systems. These target systems can be different operating systems, different processors, or a combination of the two. A concrete example would be a compiler that runs on an Intel-based Windows system and produces programs for PowerPC - based Linux systems. Is it when the target platform is an embedded system which is suitable even for non- development and translation, we also speak of a target compiler.

Typical areas of application

Cross-compilers are needed for various reasons and used:

  • With them, an operating system, program, or even the compiler itself can be ported to a new hardware platform on which the operating system or compiler was not yet available.
  • It can be with them to create programs for embedded systems that do not have the resources to run a compiler itself ( for example, if these systems have low memory or the hard disk have ).
  • You can run on fast systems and create compilations for slower systems. Doing this will save take a very long time. Especially in embedded systems often comparatively slow processors are used, which would require hours to produce a desired program while a current server can possibly do this job in a few minutes.
  • You can on an integration server compilations, such as nightly builds, generate for different target platforms.
  • The development can be more comfortable, accomplished for example by means of an IDE on a system, see, eg, cc65 for the Commodore 64

Many manufacturers of processors for embedded systems provide their clients with appropriate target compiler, mostly for the C programming language and runs on one or more major operating systems.

Popular examples

Popular free compilers, which are suitable for supply for use as a cross- compiler, are, for example, the GNU Compiler Collection and the Free Pascal compiler. For some 8 -bit target systems ( microcontrollers from the MCS -51 series, Zilog Z80, Dallas 80C390, Motorola HC08, Microchip PIC), the Small Device C Compiler also free is. For old 6502 -based computer architectures, there is the cc65 compiler.