Build Go toolchains with native standard libraries for cross-compilation to all platforms.
gonative is a tool that creates a Go build capable of cross-compiling to all platforms while using Cgo-enabled versions of the standard library. It solves the limitation where cross-compiled Go binaries lack native DNS resolution, system certificate access, and proper os/user functionality due to missing Cgo, making cross-compiled binaries suitable for production use.
Go developers who need to cross-compile production-ready binaries for multiple platforms, particularly those requiring native DNS resolution, system certificate access, or os/user functionality.
Developers choose gonative because it provides a pragmatic solution by leveraging official Go binary distributions to create a cross-compilation toolchain with native standard libraries, ensuring cross-compiled applications are production-ready without modifying existing Go installations.
Build Go Toolchains /w native libs for cross-compilation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages official Go binary distributions to copy pkg/OS_ARCH directories, ensuring Cgo-enabled stdlib for DNS resolution, system certificates, and os/user functionality.
Builds a new Go installation in a separate directory without modifying existing setups, as stated in the README, preventing conflicts.
Sets correct modification times on copied libraries to avoid unnecessary rebuilds, optimizing compilation efficiency.
Copies auto-generated runtime source files (z*_) for each platform, ensuring proper functionality in cross-compiled binaries.
Only helps with standard library Cgo; if your own packages rely on Cgo, gonative provides no assistance, limiting its use for projects with native bindings.
Cannot cross-compile to linux/arm due to lack of official Go builds, a significant gap for targeting ARM-based servers or IoT devices.
Explicitly noted as untested on Windows in the README, risking compatibility and stability issues for developers on that OS.