Rollup merge of #145320 - Kobzol:fix-cranelift-codegen-dist, r=shepmaster

Allow cross-compiling the Cranelift dist component

Should help unblock https://github.com/rust-lang/rust/pull/145252 (https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/macos-13.20shutting.20down/with/534032174).
This commit is contained in:
Jakub Beránek 2025-08-13 07:03:51 +02:00 committed by GitHub
commit c4e82abe93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -1410,6 +1410,7 @@ impl Step for Miri {
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct CraneliftCodegenBackend {
pub build_compiler: Compiler,
pub target: TargetSelection,
}
impl Step for CraneliftCodegenBackend {
@ -1437,6 +1438,7 @@ impl Step for CraneliftCodegenBackend {
run.builder.config.host_target,
run.target,
),
target: run.target,
});
}
@ -1448,7 +1450,7 @@ impl Step for CraneliftCodegenBackend {
return None;
}
let target = self.build_compiler.host;
let target = self.target;
let compilers =
RustcPrivateCompilers::from_build_compiler(builder, self.build_compiler, target);
if !target_supports_cranelift_backend(target) {
@ -1608,6 +1610,7 @@ impl Step for Extended {
add_component!("analysis" => Analysis { compiler, target });
add_component!("rustc-codegen-cranelift" => CraneliftCodegenBackend {
build_compiler: compiler,
target
});
add_component!("llvm-bitcode-linker" => LlvmBitcodeLinker {
build_compiler: compiler,

View file

@ -282,6 +282,7 @@ install!((self, builder, _config),
RustcCodegenCranelift, alias = "rustc-codegen-cranelift", Self::should_build(_config), only_hosts: true, {
if let Some(tarball) = builder.ensure(dist::CraneliftCodegenBackend {
build_compiler: self.compiler,
target: self.target
}) {
install_sh(builder, "rustc-codegen-cranelift", self.compiler.stage, Some(self.target), &tarball);
} else {