Cross-compilation is the practice of building software on one kind of machine so that it will run on a different kind of machine. The GCC internals documentation defines the three roles involved: the build is “the machine where compilation occurs,” the host is “the machine where the compiled GCC will run,” and the target is “the machine for which GCC produces code.”
A cross-compiler is the case where the program is built and runs on one system but generates code for another. In GCC’s terms, this is when build and host are the same but the target is different: the resulting compiler runs on the same system where it was built yet emits code for a different platform. This is what makes it possible to develop on a powerful desktop computer while producing programs for a small embedded device that could never compile them itself.
Cross-compilation is fundamental to embedded systems, where the target hardware often lacks the memory, speed, or operating system needed to run a compiler at all. It is equally important for distributing software across many platforms from a single development machine.
Some modern languages treat this capability as a headline feature rather than an advanced configuration. Zig’s official overview describes cross-compiling as “a first-class use case,” meaning a single toolchain can target many platforms from one host without assembling a separate toolchain for each, an approach that has become a major selling point for newer systems languages.