From 9d0149ed37c47eef29d2a717814a37227dd909aa Mon Sep 17 00:00:00 2001 From: LeSeulArtichaut Date: Fri, 29 May 2020 18:20:24 +0200 Subject: [PATCH] Document `RUSTFLAGS_STAGE_` bootstrap environment variables (#728) * Document `RUSTFLAGS_STAGE_` * Fix typos Co-authored-by: Yuki Okushi --- src/doc/rustc-dev-guide/src/building/bootstrapping.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/doc/rustc-dev-guide/src/building/bootstrapping.md b/src/doc/rustc-dev-guide/src/building/bootstrapping.md index 5bdc8dc6f18b..5ba8ef88d375 100644 --- a/src/doc/rustc-dev-guide/src/building/bootstrapping.md +++ b/src/doc/rustc-dev-guide/src/building/bootstrapping.md @@ -159,6 +159,16 @@ links against. This `stage2/bin/rustc` compiler is shipped to end-users, along with the `stage 1 {std,rustc}` artifacts. +## Passing stage-specific flags to `rustc` + +`x.py` allows you to pass stage-specific flags to `rustc` when bootstrapping. +The `RUSTFLAGS_STAGE_0`, `RUSTFLAGS_STAGE_1` and `RUSTFLAGS_STAGE_2` +environment variables pass the given flags when building stage 0, 1, and 2 +artifacts respectively. + +Additionally, the `RUSTFLAGS_STAGE_NOT_0` variable, as its name suggests, pass +the given arguments if the stage is not 0. + ## Environment Variables During bootstrapping, there are a bunch of compiler-internal environment