gcc-toolchain

🚀️ GCC cross-compiler toolchain targeting older glibc versions and musl - just download and use it.

GitHub Release Downloads License Changelog

Install

The command installs toolchain to /opt. Replace it with a different path if needed.

curl -sSL https://github.com/prepkg/gcc-toolchain/releases/latest/download/gcc-x86_64-linux-gnu.tar.gz \ | sudo tar xz -C /opt

Why?

Modern alternative to old distros

The usual method for producing portable Linux binaries is to compile them on an outdated distribution (e.g., CentOS 7). This toolchain lets you build on a modern system while targeting older environments.

glibc compatibility

The toolchain is configured to target an older glibc, ensuring compatibility and preventing errors like: /lib64/libc.so.6: version GLIBC_2.XX not found.

musl for fully static binaries

The toolchain provides musl targets that produce fully static binaries with no dynamic library dependencies, maximizing portability across any Linux system.

No build required

The toolchain is ready to download and use immediately. Building GCC from source takes hours; this skips that entirely.

Supported Toolchains

Target GCC C Library Binutils GDB OpenMP
x86_64-linux-gnu 16.1.0 glibc 2.17 2.46.1 17.2 202111
x86_64-linux-musl 16.1.0 musl 1.2.6 2.46.1 17.2 202111
aarch64-linux-gnu 16.1.0 glibc 2.26 2.46.1 17.2 202111
aarch64-linux-musl 16.1.0 musl 1.2.6 2.46.1 17.2 202111
arm-linux-gnueabi 16.1.0 glibc 2.26 2.46.1 17.2 202111
riscv64-linux-gnu 16.1.0 glibc 2.30 2.46.1 17.2 202111