"Our Compiler is an Island."
Build self-contained, OS-agnostic GCC toolchains using Docker. The resulting compiler works identically on any Linux distribution—because it carries its own world.
# Build GCC 13.3.0
./build.py 13.3.0
# Use pre-built image
docker run --rm daryltucker/gcc:13.3.0 gcc --versionDocker Hub Registries:
- daryltucker/gcc - Complete GCC toolchains
- daryltucker/binutils - Standalone binutils for custom toolchain builds
Pull from Docker Hub: docker pull daryltucker/gcc:<tag>
| Tag | GCC | Status |
|---|---|---|
9.5.0 |
9.5.0 | ✅ Sovereign |
10.2.0 |
10.2.0 | ✅ Sovereign |
12.4.0 |
12.4.0 | ✅ Sovereign |
13.3.0 |
13.3.0 | ✅ Sovereign |
14.2.0 |
14.2.0 | ✅ Sovereign |
15.2.0 |
15.2.0 | ✅ Sovereign |
| Tag | GCC | Optimization |
|---|---|---|
12.4.0-legion_s7 |
12.4.0 | AMD Zen 3 |
13.3.0-legion_s7 |
13.3.0 | AMD Zen 3 |
| Tag | GCC | Target |
|---|---|---|
12.4.0-rpi5 |
12.4.0 | aarch64 (Raspberry Pi 5) |
7.2.0-powerpc_ps3_ppu_v7 |
7.2.0 | powerpc64 (PS3 PPU) |
7.2.0-powerpc_ps3_spu_v7 |
7.2.0 | spu (PS3 SPU) |
9.5.0-powerpc_ps3_spu_v9 |
9.5.0 | spu (PS3 SPU) |
FROM daryltucker/gcc:13.3.0 AS builder
COPY . /src
WORKDIR /src
RUN gcc -o myapp main.c
FROM debian:bookworm-slim
COPY --from=builder /src/myapp /usr/local/bin/
COPY --from=builder /opt/toolchains /opt/toolchains
CMD ["myapp"]docker run --rm -v $(pwd):/src -w /src daryltucker/gcc:13.3.0 gcc -o myapp main.cdocker create --name gcc-extract daryltucker/gcc:12.4.0
docker cp gcc-extract:/opt/toolchains ./toolchains
docker rm gcc-extractNote: Our toolchains use "Sovereign RPATH"—binaries automatically find their runtime libraries without setting
LD_LIBRARY_PATH. You must preserve the original/opt/toolchains/...path.
# List available versions
./build.py --list-versions
# Build native (x86_64)
./build.py 12.4.0
# Build with hardware optimization
./build.py 12.4.0 --profile legion_s7
# Cross-compile for ARM
./build.py 12.4.0 --profile rpi5
# Control parallelism (preserves cache)
JOBS=16 ./build.py 13.3.0| Option | Description |
|---|---|
--profile |
Hardware optimization (e.g., rpi5, legion_s7) |
--target |
Specific triplet (e.g., aarch64-linux-gnu) |
--no-cache |
Force full rebuild |
--list-versions |
List all GCC versions |
--list-profiles |
List all profiles |
Every toolchain is built in seven passes:
- Binutils — Assembler and linker
- Linux Headers — Kernel API for glibc
- GCC Bootstrap — Minimal C compiler
- Glibc — C library
- Zlib — Compression library
- GCC Final — Full C/C++/Fortran compiler
- Validation — Tests: C, C++, Fortran, OpenMP, shared libs, LTO
Binaries compiled by our toolchains automatically find their runtime libraries (libstdc++, libgcc_s, libgfortran) without setting LD_LIBRARY_PATH.
This is achieved by patching GCC's specs file to inject -rpath flags pointing to the toolchain's library directory. The result: truly portable binaries.
Verification:
docker run --rm daryltucker/gcc:13.3.0 sh -c '
echo "int main(){}" | gcc -x c - -o /tmp/test
/tmp/test && echo "Binary runs without LD_LIBRARY_PATH"
'- Hermetic Isolation — The compiler works identically everywhere
- Self-Reliance — No
apt-get install; we build dependencies from source - Time Capsule — We recreate the exact ecosystem the compiler expects
- Sovereign RPATH — Binaries find their libraries without environment hacks
gcc-docker/
├── configs/ # Production JSON configurations
├── profiles/ # Hardware optimization profiles
├── scripts/ # Build orchestration
├── templates/ # Jinja2 Dockerfile templates
├── patches/ # Source code patches
├── out/ # Build outputs (gitignored)
└── cache/ # Downloaded tarballs (gitignored)
- Docker
- Python 3
- wget
- GnuPG (gpg)
MIT