@@ -145,7 +145,7 @@ impl Step for ToolBuild {
145
145
tool = "rust-tidy" ;
146
146
}
147
147
let tool_path =
148
- copy_link_tool_bin ( builder, target_compiler , self . target , self . mode , tool) ;
148
+ copy_link_tool_bin ( builder, self . compiler , self . target , self . mode , tool) ;
149
149
150
150
ToolBuildResult { tool_path, build_compiler : self . compiler , target_compiler }
151
151
}
@@ -976,50 +976,30 @@ impl Step for LlvmBitcodeLinker {
976
976
instrument( level = "debug" , name = "LlvmBitcodeLinker::run" , skip_all)
977
977
) ]
978
978
fn run ( self , builder : & Builder < ' _ > ) -> PathBuf {
979
- let bin_name = "llvm-bitcode-linker" ;
980
-
981
- // If enabled, use ci-rustc and skip building the in-tree compiler.
982
- if !builder. download_rustc ( ) {
983
- builder. ensure ( compile:: Std :: new ( self . compiler , self . compiler . host ) ) ;
984
- builder. ensure ( compile:: Rustc :: new ( self . compiler , self . target ) ) ;
985
- }
986
-
987
- let cargo = prepare_tool_cargo (
988
- builder,
989
- self . compiler ,
990
- Mode :: ToolRustc ,
991
- self . target ,
992
- Kind :: Build ,
993
- "src/tools/llvm-bitcode-linker" ,
994
- SourceType :: InTree ,
995
- & self . extra_features ,
996
- ) ;
997
-
998
- let _guard = builder. msg_tool (
999
- Kind :: Build ,
1000
- Mode :: ToolRustc ,
1001
- bin_name,
1002
- self . compiler . stage ,
1003
- & self . compiler . host ,
1004
- & self . target ,
1005
- ) ;
1006
-
1007
- cargo. into_cmd ( ) . run ( builder) ;
1008
-
1009
- let tool_out = builder
1010
- . cargo_out ( self . compiler , Mode :: ToolRustc , self . target )
1011
- . join ( exe ( bin_name, self . compiler . host ) ) ;
979
+ let ToolBuildResult { tool_path, build_compiler : _build_compiler, target_compiler } =
980
+ builder. ensure ( ToolBuild {
981
+ compiler : self . compiler ,
982
+ target : self . target ,
983
+ tool : "llvm-bitcode-linker" ,
984
+ mode : Mode :: ToolRustc ,
985
+ path : "src/tools/llvm-bitcode-linker" ,
986
+ source_type : SourceType :: InTree ,
987
+ extra_features : self . extra_features ,
988
+ allow_features : "" ,
989
+ cargo_args : Vec :: new ( ) ,
990
+ } ) ;
1012
991
1013
- if self . compiler . stage > 0 {
992
+ if target_compiler . stage > 0 {
1014
993
let bindir_self_contained = builder
1015
- . sysroot ( self . compiler )
994
+ . sysroot ( target_compiler )
1016
995
. join ( format ! ( "lib/rustlib/{}/bin/self-contained" , self . target. triple) ) ;
1017
996
t ! ( fs:: create_dir_all( & bindir_self_contained) ) ;
1018
- let bin_destination = bindir_self_contained. join ( exe ( bin_name, self . compiler . host ) ) ;
1019
- builder. copy_link ( & tool_out, & bin_destination) ;
997
+ let bin_destination =
998
+ bindir_self_contained. join ( exe ( "llvm-bitcode-linker" , target_compiler. host ) ) ;
999
+ builder. copy_link ( & tool_path, & bin_destination) ;
1020
1000
bin_destination
1021
1001
} else {
1022
- tool_out
1002
+ tool_path
1023
1003
}
1024
1004
}
1025
1005
}
@@ -1171,7 +1151,7 @@ fn run_tool_build_step(
1171
1151
path : & ' static str ,
1172
1152
add_bins_to_sysroot : Option < & [ & str ] > ,
1173
1153
) -> PathBuf {
1174
- let tool = builder
1154
+ let ToolBuildResult { tool_path , build_compiler : _build_compiler , target_compiler } = builder
1175
1155
. ensure ( ToolBuild {
1176
1156
compiler,
1177
1157
target,
@@ -1182,28 +1162,24 @@ fn run_tool_build_step(
1182
1162
source_type : SourceType :: InTree ,
1183
1163
allow_features : "" ,
1184
1164
cargo_args : vec ! [ ] ,
1185
- } )
1186
- . tool_path ;
1165
+ } ) ;
1187
1166
1188
1167
// FIXME: This should just be an if-let-chain, but those are unstable.
1189
1168
if let Some ( add_bins_to_sysroot) =
1190
- add_bins_to_sysroot. filter ( |bins| !bins. is_empty ( ) && compiler . stage > 0 )
1169
+ add_bins_to_sysroot. filter ( |bins| !bins. is_empty ( ) && target_compiler . stage > 0 )
1191
1170
{
1192
- let bindir = builder. sysroot ( compiler ) . join ( "bin" ) ;
1171
+ let bindir = builder. sysroot ( target_compiler ) . join ( "bin" ) ;
1193
1172
t ! ( fs:: create_dir_all( & bindir) ) ;
1194
1173
1195
- let tools_out = builder. cargo_out ( compiler, Mode :: ToolRustc , target) ;
1196
-
1197
1174
for add_bin in add_bins_to_sysroot {
1198
- let bin_source = tools_out. join ( exe ( add_bin, target) ) ;
1199
- let bin_destination = bindir. join ( exe ( add_bin, compiler. host ) ) ;
1200
- builder. copy_link ( & bin_source, & bin_destination) ;
1175
+ let bin_destination = bindir. join ( exe ( add_bin, target_compiler. host ) ) ;
1176
+ builder. copy_link ( & tool_path, & bin_destination) ;
1201
1177
}
1202
1178
1203
1179
// Return a path into the bin dir.
1204
- bindir. join ( exe ( tool_name, compiler . host ) )
1180
+ bindir. join ( exe ( tool_name, target_compiler . host ) )
1205
1181
} else {
1206
- tool
1182
+ tool_path
1207
1183
}
1208
1184
}
1209
1185
0 commit comments