File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -334,7 +334,8 @@ pub fn prepare_tool_cargo(
334
334
/// Determines how to build a `ToolTarget`, i.e. which compiler should be used to compile it.
335
335
/// The compiler stage is automatically bumped if we need to cross-compile a stage 1 tool.
336
336
pub enum ToolTargetBuildMode {
337
- /// Build the tool using rustc that corresponds to the selected CLI stage.
337
+ /// Build the tool for the given `target` using rustc that corresponds to the top CLI
338
+ /// stage.
338
339
Build ( TargetSelection ) ,
339
340
/// Build the tool so that it can be attached to the sysroot of the passed compiler.
340
341
/// Since we always dist stage 2+, the compiler that builds the tool in this case has to be
@@ -366,7 +367,10 @@ pub(crate) fn get_tool_target_compiler(
366
367
} else {
367
368
// If we are cross-compiling a stage 1 tool, we cannot do that with a stage 0 compiler,
368
369
// so we auto-bump the tool's stage to 2, which means we need a stage 1 compiler.
369
- builder. compiler ( build_compiler_stage. max ( 1 ) , builder. host_target )
370
+ let build_compiler = builder. compiler ( build_compiler_stage. max ( 1 ) , builder. host_target ) ;
371
+ // We also need the host stdlib to compile host code (proc macros/build scripts)
372
+ builder. std ( build_compiler, builder. host_target ) ;
373
+ build_compiler
370
374
} ;
371
375
builder. std ( compiler, target) ;
372
376
compiler
Original file line number Diff line number Diff line change @@ -985,6 +985,7 @@ mod snapshot {
985
985
. render_steps( ) , @r"
986
986
[build] llvm <host>
987
987
[build] rustc 0 <host> -> rustc 1 <host>
988
+ [build] rustc 1 <host> -> std 1 <host>
988
989
[build] rustc 1 <host> -> std 1 <target1>
989
990
[build] rustc 1 <host> -> cargo 2 <target1>
990
991
" ) ;
You can’t perform that action at this time.
0 commit comments