@@ -1546,6 +1546,7 @@ impl Step for Extended {
1546
1546
compiler: builder. compiler( stage, target) ,
1547
1547
backend: "cranelift" . to_string( ) ,
1548
1548
} ) ;
1549
+ add_component ! ( "llvm-bitcode-linker" => LlvmBitcodeLinker { compiler, target} ) ;
1549
1550
1550
1551
let etc = builder. src . join ( "src/etc/installer" ) ;
1551
1552
@@ -2222,6 +2223,53 @@ impl Step for LlvmTools {
2222
2223
}
2223
2224
}
2224
2225
2226
+ #[ derive( Debug , PartialOrd , Ord , Clone , Hash , PartialEq , Eq ) ]
2227
+ pub struct LlvmBitcodeLinker {
2228
+ pub compiler : Compiler ,
2229
+ pub target : TargetSelection ,
2230
+ }
2231
+
2232
+ impl Step for LlvmBitcodeLinker {
2233
+ type Output = Option < GeneratedTarball > ;
2234
+ const DEFAULT : bool = true ;
2235
+ const ONLY_HOSTS : bool = true ;
2236
+
2237
+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
2238
+ let default = should_build_extended_tool ( run. builder , "llvm-bitcode-linker" ) ;
2239
+ run. alias ( "llvm-bitcode-linker" ) . default_condition ( default)
2240
+ }
2241
+
2242
+ fn make_run ( run : RunConfig < ' _ > ) {
2243
+ run. builder . ensure ( LlvmBitcodeLinker {
2244
+ compiler : run. builder . compiler_for (
2245
+ run. builder . top_stage ,
2246
+ run. builder . config . build ,
2247
+ run. target ,
2248
+ ) ,
2249
+ target : run. target ,
2250
+ } ) ;
2251
+ }
2252
+
2253
+ fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
2254
+ let compiler = self . compiler ;
2255
+ let target = self . target ;
2256
+
2257
+ let llbc_linker =
2258
+ builder. ensure ( tool:: LlvmBitcodeLinker { compiler, target, extra_features : vec ! [ ] } ) ;
2259
+
2260
+ let self_contained_bin_dir = format ! ( "lib/rustlib/{}/bin/self-contained" , target. triple) ;
2261
+
2262
+ // Prepare the image directory
2263
+ let mut tarball = Tarball :: new ( builder, "llvm-bitcode-linker" , & target. triple ) ;
2264
+ tarball. set_overlay ( OverlayKind :: LlvmBitcodeLinker ) ;
2265
+ tarball. is_preview ( true ) ;
2266
+
2267
+ tarball. add_file ( llbc_linker, self_contained_bin_dir, 0o755 ) ;
2268
+
2269
+ Some ( tarball. generate ( ) )
2270
+ }
2271
+ }
2272
+
2225
2273
// Tarball intended for internal consumption to ease rustc/std development.
2226
2274
//
2227
2275
// Should not be considered stable by end users.
0 commit comments