← 🏭 Phases of a Compiler
Subtopic 3 of 3

1.3Cross compilers and bootstrapping

A cross compiler runs on machine A but generates code for machine B. Bootstrapping: write a small compiler for a subset of a language, then use it to compile a bigger compiler written in that language. T-diagrams track source language, target language and implementation language.

Machine A (host)compiler runs here
Cross compilerL → code for B
Object code-
Machine B (target)-
  • The compiler is installed and runs on machine A
  • Feed it a program in language L: it generates machine code for B
  • Copy the object code to machine B (which may have no compiler at all) and run it

Previous year questions: Phases of a Compiler (4)

PYQs are grouped by topic, so this is the full set for Phases of a Compiler; try the ones that match this subtopic. Open all 4 on the topic page.