Skip to content

Commit c4e82ab

Browse files
authored
Rollup merge of rust-lang#145320 - Kobzol:fix-cranelift-codegen-dist, r=shepmaster
Allow cross-compiling the Cranelift dist component Should help unblock rust-lang#145252 (https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/macos-13.20shutting.20down/with/534032174).
2 parents b60d5b3 + 614364c commit c4e82ab

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@ impl Step for Miri {
14101410
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
14111411
pub struct CraneliftCodegenBackend {
14121412
pub build_compiler: Compiler,
1413+
pub target: TargetSelection,
14131414
}
14141415

14151416
impl Step for CraneliftCodegenBackend {
@@ -1437,6 +1438,7 @@ impl Step for CraneliftCodegenBackend {
14371438
run.builder.config.host_target,
14381439
run.target,
14391440
),
1441+
target: run.target,
14401442
});
14411443
}
14421444

@@ -1448,7 +1450,7 @@ impl Step for CraneliftCodegenBackend {
14481450
return None;
14491451
}
14501452

1451-
let target = self.build_compiler.host;
1453+
let target = self.target;
14521454
let compilers =
14531455
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, target);
14541456
if !target_supports_cranelift_backend(target) {
@@ -1608,6 +1610,7 @@ impl Step for Extended {
16081610
add_component!("analysis" => Analysis { compiler, target });
16091611
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {
16101612
build_compiler: compiler,
1613+
target
16111614
});
16121615
add_component!("llvm-bitcode-linker" => LlvmBitcodeLinker {
16131616
build_compiler: compiler,

src/bootstrap/src/core/build_steps/install.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ install!((self, builder, _config),
282282
RustcCodegenCranelift, alias = "rustc-codegen-cranelift", Self::should_build(_config), only_hosts: true, {
283283
if let Some(tarball) = builder.ensure(dist::CraneliftCodegenBackend {
284284
build_compiler: self.compiler,
285+
target: self.target
285286
}) {
286287
install_sh(builder, "rustc-codegen-cranelift", self.compiler.stage, Some(self.target), &tarball);
287288
} else {

0 commit comments

Comments
 (0)