cross compilation

Building a program on one kind of machine for a different operating system or processor, such as a Linux binary on a Mac.

In more detail

It lets one build machine produce programs for every platform you ship to, such as a laptop producing a Linux build for a container. Some languages need a separate toolchain per target; others, such as Go, only need a setting changed. Code that links to C libraries usually needs a C toolchain for the target too.

Example

GOOS=linux GOARCH=amd64 go build -o probe .

Related terms

Taught in

References