Since obsidian.systems and zw3rk posted the Cross Compilation survey (and results), I have been writing about cross compiling to Raspberry Pi, and specifically building a SDK for Raspbian Jessie, and a Haskell cross compiler, one topic has been coming up repeatedly: Why use a Cross Compiler?

For those who work in the mobile application space, cross compilation is very likely an essential part of their day. iOS and Android apps are naturally cross compiled, even though this fact is mostly hidden away. In both cases the application is developed on a much more powerful machine than the one it is finally deployed to (or tested on).

Power Differences

This leads us to the first reason for using a cross compiler. If the machine that builds the software is much more powerful than the one that finally hosts and runs the software, it make economical sense to use the more powerful machine to do the compilation.

Resource Constraints

Another reason to use a cross compiler is the fact that the target that is finally hosting the software might be ressource constraint in a way that prohibits or severely hinders the execution of the compiler. While the ressources are perfectly fine for running the compiled software, they might not be adequate to run the compiler.

Environmental Restrictions

A third reason for using a cross compiler could stem from the restrictions put onto the environment that governs the target. If the target simply does not admit to running the compiler or necessary toolchain to compile the software, the software must be compiled on a different build machine.