A hands-on guide to building a host-tuned GCC 16 that compiles code faster by combining three key optimizations: native CPU targeting (bootstrap-native), O3 optimization level, and profile-guided optimization (PGO) via the profiledbootstrap make target. Benchmarks across four real-world codebases (GCC itself, binutils, SDL, CPython) show 12–24% compile time improvements over an Arch Linux distro GCC that already uses LTO. The build takes ~72 minutes on a 16-core machine but yields a persistent speedup for all future compilations.

5m read timeFrom peter0x44.github.io
Post cover image
Table of contents
How to Build It #Configure Options Explained #Benchmark Comparison #Benchmark Results #Disclaimers #Conclusion #

Sort: