From a569c249c297a7c3e36ff80aeddf6f42aca5abe6 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 13 Jul 2018 18:45:13 -0600 Subject: [PATCH] Do not attempt to recompile codegen backend(s) with --keep-stage Previously we'd attempt to recompile them and that would fail since we've essentially not built the entire compiler yet, or we're faking that fact. This commit should make us ignore the codegen backend build as well. Unlike the other compile steps, there is no CodegenBackendLink step that we run here, because that is done later as a part of assembling the final compiler and as an explicit function call. --- src/bootstrap/compile.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 7d94bac66f77..8cfd85590169 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -660,6 +660,16 @@ impl Step for CodegenBackend { builder.ensure(Rustc { compiler, target }); + if let Some(keep_stage) = builder.config.keep_stage { + if keep_stage <= compiler.stage { + println!("Warning: Using a potentially old codegen backend. \ + This may not behave well."); + // Codegen backends are linked separately from this step today, so we don't do + // anything here. + return; + } + } + if builder.force_use_stage1(compiler, target) { builder.ensure(CodegenBackend { compiler: builder.compiler(1, builder.config.build),