Compilers · Cluster

Toolchain Engineering

Build systems, cross compilation, and diagnostics.

  1. 01 How a Compiler Driver Dispatches Work to Preprocessor, Compiler, Assembler, and Linker The program named cc compiles nothing itself. It parses one command line, routes each option to the stage that understands it, and chains four subprocesses through temporary files. foundational · Dec 22, 2021
  2. 02 Header Dependency Discovery: Why the Compiler Records Includes, Not the Build Tool Reconstructing a translation unit's header list by scanning source text fails on conditional and computed includes. The front end already knows which files it opened, and it can write that list as a makefile fragment. foundational · Aug 5, 2024
  3. 03 Target Triples, Sysroots, and What Actually Changes When Cross-Compiling A triple names an architecture, vendor, operating system, and ABI. The hard part of cross-compilation is not instruction selection but the header tree, startup objects, and libraries that the triple implies. foundational · Sep 16, 2026
  4. 04 Sources of Nondeterminism in Compiled Artifacts and How They Are Removed Two builds of the same source can differ in embedded timestamps, temporary paths, hash-map iteration order, and archive member metadata. Each leak has a specific mechanism and a specific suppression. intermediate · Jan 25, 2024
  5. 05 Scheduling a Parallel Build from a Dependency Graph A build is a DAG of commands with known costs and unknown costs alike. Choosing what to run next determines both wall-clock time and how badly a late-discovered dependency hurts. intermediate · Feb 15, 2023
  6. 06 Content-Addressed Build Cache Keys: What Must Go Into the Hash A cache hit is only sound if the key covers every input that can change the output. The compiler binary, its flags, the header contents, and the transitive environment all belong in it; the clock and the path usually do not. intermediate · May 29, 2026
  7. 07 Reading a Preprocessor Diagnostic Through Macro Expansion Preprocessor errors cite a line that may contain no error at all. Tracking the expansion stack, the difference between a file and a macro origin, and where note lines come from turns the output into a usable trace. intermediate · Apr 2, 2026
  8. 08 Hermetic Build Actions: Enforcing That Compilation Reads Only Declared Inputs A declared input list is a promise. Making the promise enforceable means restricting the file system, the clock, and the network, and choosing which of those restrictions is worth its cost. advanced · Jan 17, 2026
  9. 09 Debug Information for Optimized Code: Line Tables, Location Lists, and Lost Variables At -O2 the compiler moves, merges, and deletes variables. DWARF describes the result with location lists and inline scopes, and the debugger reconstructs values that no longer live anywhere. advanced · Mar 22, 2025
  10. 10 Bootstrapping a Self-Hosted Compiler and Why the Build Is Compared Against Itself A compiler written in its own language cannot be built from nothing. Three-stage bootstrapping solves the chicken-and-egg problem and turns the second and third stages into a self-check of the whole toolchain. advanced · Jul 9, 2024