Cross-compile and link a static binary on macOS for Linux with cargo and rust One Go feature which I’m using regularly is cross-compiling Go code to other platforms (usually from macOS to linux-amd64). In Go, this is a built-in feature that “just works”. The following command produces a statically linked ELF binary which can simply be copied and run on a Linux machine: $ GOARCH=amd64 GOOS=linux go