This repository builds packaged GNU toolchains with Crosstool-NG and emits versioned tarballs under output/. It produces toolchains for GCC 12 and GCC 15 on x86_64 and aarch64 Linux targets, and includes the configuration, container image, per-package checksum overrides, and any backported security patches needed to reproduce those builds.
The build flow has three parts:
Dockerfilecreates a build image with Crosstool-NG 1.28.0 and the host dependencies needed to runct-ng.docker_build_and_run.shbuilds that image and launchesbuild.shinside the container with the requested architecture and GCC major version.build.shrunsct-ng defconfigandct-ng build, then packages the generated toolchain into a.tar.gzarchive plus a SHA-256 checksum file.
The result is a redistributable toolchain archive rooted at the target triplet, for example x86_64-unknown-linux-gnu, with bin/, lib/, include/, sysroot/, and related directories inside it.
The checked-in target configurations currently cover:
| Target triplet | ARCH value |
GCC | Config file |
|---|---|---|---|
x86_64-unknown-linux-gnu |
x86_64 |
12 | configs/x86_64-unknown-linux-gnu_gcc12 |
x86_64-unknown-linux-gnu |
x86_64 |
15 | configs/x86_64-unknown-linux-gnu_gcc15 |
aarch64-unknown-linux-gnu |
arm64 or aarch64 |
12 | configs/aarch64-unknown-linux-gnu_gcc12 |
aarch64-unknown-linux-gnu |
arm64 or aarch64 |
15 | configs/aarch64-unknown-linux-gnu_gcc15 |
All configs are pinned to the following component versions:
| Component | GCC 12 toolchains | GCC 15 toolchains |
|---|---|---|
| Crosstool-NG | 1.28.0 |
1.28.0 |
| GCC | 12.2.0 |
15.3.0 |
| Linux headers | 5.15 |
7.1.4 |
| binutils | 2.34 |
2.46.1 |
| glibc | 2.31 |
2.39 |
All configs enable C++ support and build a static toolchain.
build.sh: main build and packaging entrypoint.docker_build_and_run.sh: recommended wrapper for local and CI builds.Dockerfile: reproducible build environment for Crosstool-NG.configs/: one Crosstool-NG defconfig per supported target/GCC combination.additional_packages/: per-component overrides (checksums,version.desc, patches) copied into the container's Crosstool-NG package tree.output/: generated source download cache, intermediate build trees, unpacked toolchains, final archives, and.sha256files.
Docker is the canonical way to build because the image pins the Crosstool-NG version and installs the tool dependencies expected by the configs.
- Docker installed locally
- Permission to run
docker buildanddocker run - Enough disk space for source downloads and full toolchain builds
Build the x86_64 GCC 12 toolchain:
./docker_build_and_run.sh x86_64 12Build the x86_64 GCC 15 toolchain:
./docker_build_and_run.sh x86_64 15Build the aarch64 GCC 15 toolchain:
./docker_build_and_run.sh aarch64 15The wrapper script:
- builds the local image
ctng-image:1.28.0 - mounts the repository into
/workspaceinside the container - runs
GCC=<version> ARCH=<arch> ./build.sh - preserves file ownership on the host with
--user "$(id -u):$(id -g)"
Manual builds are possible, but build.sh assumes ct-ng is already installed and compatible with the checked-in configs. In practice that means matching the container setup closely, especially Crosstool-NG 1.28.0 and the per-package checksum overrides in additional_packages/.
At minimum:
export GCC=15 # or 12
export ARCH=x86_64
./build.shSupported ARCH values are:
x86_64arm64aarch64
Any other value is rejected by build.sh.
For a successful build, build.sh creates:
output/<target>_gcc<major>/: unpacked toolchain prefix generated by Crosstool-NGoutput/<target>_gcc<major>.tar.gz: packaged toolchain archiveoutput/<target>_gcc<major>.tar.gz.sha256: checksum for the archiveoutput/downloads/: source tarball cache used by Crosstool-NG
For example, building ARCH=x86_64 and GCC=12 produces:
output/
├── downloads/
├── x86_64-unknown-linux-gnu_gcc12/
├── x86_64-unknown-linux-gnu_gcc12.tar.gz
└── x86_64-unknown-linux-gnu_gcc12.tar.gz.sha256
Inside the unpacked toolchain prefix you will find the target-rooted tree, including binaries such as:
output/x86_64-unknown-linux-gnu_gcc12/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc
output/x86_64-unknown-linux-gnu_gcc12/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++
output/x86_64-unknown-linux-gnu_gcc12/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-ld
build.sh packages the final archive with stable tar ordering and normalized ownership, then writes a SHA-256 checksum next to the tarball for downstream verification.
To add another target or GCC major version, create a new Crosstool-NG config in configs/ that follows the existing naming convention:
configs/<target-triplet>_gcc<major>
The build scripts derive the target triplet and output paths from that naming scheme, so keeping it consistent avoids additional script changes.
Releases are published to GitHub Releases via the CI pipeline (.github/workflows/release.yml). Pushing a v* tag builds all four target/GCC combinations in parallel and attaches the resulting .tar.gz and .sha256 files to the release.
Each release archive contains the bundled license texts for all third-party components under <target-triplet>/share/licenses/. See NOTICE for the full list of components and their upstream source locations.
This repository is licensed under Apache License 2.0. See LICENSE and NOTICE for details.