Let abi-checker take the full path to the cg_clif dylib
This commit is contained in:
parent
917be273ab
commit
b12286fec3
@ -10,7 +10,7 @@ pub(crate) fn run(
|
|||||||
channel: &str,
|
channel: &str,
|
||||||
sysroot_kind: SysrootKind,
|
sysroot_kind: SysrootKind,
|
||||||
target_dir: &Path,
|
target_dir: &Path,
|
||||||
cg_clif_build_dir: &Path,
|
cg_clif_dylib: &Path,
|
||||||
host_triple: &str,
|
host_triple: &str,
|
||||||
target_triple: &str,
|
target_triple: &str,
|
||||||
) {
|
) {
|
||||||
@ -29,7 +29,7 @@ pub(crate) fn run(
|
|||||||
channel,
|
channel,
|
||||||
sysroot_kind,
|
sysroot_kind,
|
||||||
target_dir,
|
target_dir,
|
||||||
cg_clif_build_dir,
|
cg_clif_dylib,
|
||||||
host_triple,
|
host_triple,
|
||||||
target_triple,
|
target_triple,
|
||||||
);
|
);
|
||||||
@ -39,11 +39,6 @@ pub(crate) fn run(
|
|||||||
abi_checker_path.push("abi-checker");
|
abi_checker_path.push("abi-checker");
|
||||||
env::set_current_dir(abi_checker_path.clone()).unwrap();
|
env::set_current_dir(abi_checker_path.clone()).unwrap();
|
||||||
|
|
||||||
let build_dir = abi_checker_path.parent().unwrap().join("build");
|
|
||||||
let cg_clif_dylib_path = build_dir.join(if cfg!(windows) { "bin" } else { "lib" }).join(
|
|
||||||
env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX,
|
|
||||||
);
|
|
||||||
|
|
||||||
let pairs = ["rustc_calls_cgclif", "cgclif_calls_rustc", "cgclif_calls_cc", "cc_calls_cgclif"];
|
let pairs = ["rustc_calls_cgclif", "cgclif_calls_rustc", "cgclif_calls_cc", "cc_calls_cgclif"];
|
||||||
|
|
||||||
let mut cmd = Command::new("cargo");
|
let mut cmd = Command::new("cargo");
|
||||||
@ -54,7 +49,7 @@ pub(crate) fn run(
|
|||||||
cmd.arg("--pairs");
|
cmd.arg("--pairs");
|
||||||
cmd.args(pairs);
|
cmd.args(pairs);
|
||||||
cmd.arg("--add-rustc-codegen-backend");
|
cmd.arg("--add-rustc-codegen-backend");
|
||||||
cmd.arg(format!("cgclif:{}", cg_clif_dylib_path.display()));
|
cmd.arg(format!("cgclif:{}", cg_clif_dylib.display()));
|
||||||
|
|
||||||
spawn_and_wait(cmd);
|
spawn_and_wait(cmd);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ use std::env;
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
|
use super::rustc_info::get_file_name;
|
||||||
use super::utils::is_ci;
|
use super::utils::is_ci;
|
||||||
|
|
||||||
pub(crate) fn build_backend(
|
pub(crate) fn build_backend(
|
||||||
@ -41,5 +42,8 @@ pub(crate) fn build_backend(
|
|||||||
eprintln!("[BUILD] rustc_codegen_cranelift");
|
eprintln!("[BUILD] rustc_codegen_cranelift");
|
||||||
super::utils::spawn_and_wait(cmd);
|
super::utils::spawn_and_wait(cmd);
|
||||||
|
|
||||||
Path::new("target").join(host_triple).join(channel)
|
Path::new("target")
|
||||||
|
.join(host_triple)
|
||||||
|
.join(channel)
|
||||||
|
.join(get_file_name("rustc_codegen_cranelift", "dylib"))
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ pub(crate) fn build_sysroot(
|
|||||||
channel: &str,
|
channel: &str,
|
||||||
sysroot_kind: SysrootKind,
|
sysroot_kind: SysrootKind,
|
||||||
target_dir: &Path,
|
target_dir: &Path,
|
||||||
cg_clif_build_dir: &Path,
|
cg_clif_dylib_src: &Path,
|
||||||
host_triple: &str,
|
host_triple: &str,
|
||||||
target_triple: &str,
|
target_triple: &str,
|
||||||
) {
|
) {
|
||||||
@ -23,7 +23,6 @@ pub(crate) fn build_sysroot(
|
|||||||
fs::create_dir_all(target_dir.join("lib")).unwrap();
|
fs::create_dir_all(target_dir.join("lib")).unwrap();
|
||||||
|
|
||||||
// Copy the backend
|
// Copy the backend
|
||||||
let cg_clif_dylib = get_file_name("rustc_codegen_cranelift", "dylib");
|
|
||||||
let cg_clif_dylib_path = target_dir
|
let cg_clif_dylib_path = target_dir
|
||||||
.join(if cfg!(windows) {
|
.join(if cfg!(windows) {
|
||||||
// Windows doesn't have rpath support, so the cg_clif dylib needs to be next to the
|
// Windows doesn't have rpath support, so the cg_clif dylib needs to be next to the
|
||||||
@ -32,8 +31,8 @@ pub(crate) fn build_sysroot(
|
|||||||
} else {
|
} else {
|
||||||
"lib"
|
"lib"
|
||||||
})
|
})
|
||||||
.join(&cg_clif_dylib);
|
.join(get_file_name("rustc_codegen_cranelift", "dylib"));
|
||||||
try_hard_link(cg_clif_build_dir.join(cg_clif_dylib), &cg_clif_dylib_path);
|
try_hard_link(cg_clif_dylib_src, &cg_clif_dylib_path);
|
||||||
|
|
||||||
// Build and copy rustc and cargo wrappers
|
// Build and copy rustc and cargo wrappers
|
||||||
for wrapper in ["rustc-clif", "cargo-clif"] {
|
for wrapper in ["rustc-clif", "cargo-clif"] {
|
||||||
|
@ -130,7 +130,7 @@ pub fn main() {
|
|||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let cg_clif_build_dir =
|
let cg_clif_dylib =
|
||||||
build_backend::build_backend(channel, &host_triple, use_unstable_features);
|
build_backend::build_backend(channel, &host_triple, use_unstable_features);
|
||||||
match command {
|
match command {
|
||||||
Command::Test => {
|
Command::Test => {
|
||||||
@ -138,7 +138,7 @@ pub fn main() {
|
|||||||
channel,
|
channel,
|
||||||
sysroot_kind,
|
sysroot_kind,
|
||||||
&target_dir,
|
&target_dir,
|
||||||
&cg_clif_build_dir,
|
&cg_clif_dylib,
|
||||||
&host_triple,
|
&host_triple,
|
||||||
&target_triple,
|
&target_triple,
|
||||||
);
|
);
|
||||||
@ -147,7 +147,7 @@ pub fn main() {
|
|||||||
channel,
|
channel,
|
||||||
sysroot_kind,
|
sysroot_kind,
|
||||||
&target_dir,
|
&target_dir,
|
||||||
&cg_clif_build_dir,
|
&cg_clif_dylib,
|
||||||
&host_triple,
|
&host_triple,
|
||||||
&target_triple,
|
&target_triple,
|
||||||
);
|
);
|
||||||
@ -157,7 +157,7 @@ pub fn main() {
|
|||||||
channel,
|
channel,
|
||||||
sysroot_kind,
|
sysroot_kind,
|
||||||
&target_dir,
|
&target_dir,
|
||||||
&cg_clif_build_dir,
|
&cg_clif_dylib,
|
||||||
&host_triple,
|
&host_triple,
|
||||||
&target_triple,
|
&target_triple,
|
||||||
);
|
);
|
||||||
|
@ -397,7 +397,7 @@ pub(crate) fn run_tests(
|
|||||||
channel: &str,
|
channel: &str,
|
||||||
sysroot_kind: SysrootKind,
|
sysroot_kind: SysrootKind,
|
||||||
target_dir: &Path,
|
target_dir: &Path,
|
||||||
cg_clif_build_dir: &Path,
|
cg_clif_dylib: &Path,
|
||||||
host_triple: &str,
|
host_triple: &str,
|
||||||
target_triple: &str,
|
target_triple: &str,
|
||||||
) {
|
) {
|
||||||
@ -408,7 +408,7 @@ pub(crate) fn run_tests(
|
|||||||
channel,
|
channel,
|
||||||
SysrootKind::None,
|
SysrootKind::None,
|
||||||
&target_dir,
|
&target_dir,
|
||||||
cg_clif_build_dir,
|
cg_clif_dylib,
|
||||||
&host_triple,
|
&host_triple,
|
||||||
&target_triple,
|
&target_triple,
|
||||||
);
|
);
|
||||||
@ -427,7 +427,7 @@ pub(crate) fn run_tests(
|
|||||||
channel,
|
channel,
|
||||||
sysroot_kind,
|
sysroot_kind,
|
||||||
&target_dir,
|
&target_dir,
|
||||||
cg_clif_build_dir,
|
cg_clif_dylib,
|
||||||
&host_triple,
|
&host_triple,
|
||||||
&target_triple,
|
&target_triple,
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user