Skip to content

Commit 4ab5fec

Browse files
committed
note about why stage1/stage2 are different
1 parent 7d87e3c commit 4ab5fec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/how-to-build-and-run.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ internally. The result is the compiling `rustc` is done in stages:
6262
compiled with the stage0 compiler to produce the stage1 compiler.
6363
However, it was built with an older compiler (stage0), so to
6464
optimize the stage1 compiler we go to next stage.
65+
- (In theory, the stage1 compiler is functionally identical to the
66+
stage2 compiler, but in practice there are subtle differences. In
67+
particular, the stage1 compiler itself was built by stage0 and
68+
hence not by the source in your working directory: this means that
69+
the symbol names used in the compiler source may not match the
70+
symbol names that would have been made by the stage1 compiler.
71+
This can be important when using dynamic linking (e.g., with
72+
derives. Sometimes this means that some tests don't work when run
73+
with stage1.)
6574
- **Stage 2:** we rebuild our stage1 compiler with itself to produce
6675
the stage2 compiler (i.e. it builds itself) to have all the _latest
6776
optimizations_.

0 commit comments

Comments
 (0)