1
Fork 0

Put rustc_codegen_cranelift.dll in bin rather than lib on Windows

rustc-clif has long been changed from a custom driver linking against
cg_clif to a wrapper around rustc which passes -Zcodegen-backend.
This commit is contained in:
bjorn3 2025-01-09 10:26:50 +00:00
parent 916a0b3225
commit 0e8e9b3887
4 changed files with 4 additions and 11 deletions

View file

@ -33,14 +33,7 @@ pub(crate) fn build_sysroot(
let cg_clif_dylib_path = match cg_clif_dylib_src {
CodegenBackend::Local(src_path) => {
// Copy the backend
let cg_clif_dylib_path = if cfg!(windows) {
// Windows doesn't have rpath support, so the cg_clif dylib needs to be next to the
// binaries.
dist_dir.join("bin")
} else {
dist_dir.join("lib")
}
.join(src_path.file_name().unwrap());
let cg_clif_dylib_path = dist_dir.join("lib").join(src_path.file_name().unwrap());
try_hard_link(src_path, &cg_clif_dylib_path);
CodegenBackend::Local(cg_clif_dylib_path)
}

View file

@ -16,7 +16,7 @@ fn main() {
if let Some(name) = option_env!("BUILTIN_BACKEND") {
rustflags.push(format!("-Zcodegen-backend={name}"));
} else {
let dylib = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join(
let dylib = sysroot.join("lib").join(
env::consts::DLL_PREFIX.to_string()
+ "rustc_codegen_cranelift"
+ env::consts::DLL_SUFFIX,

View file

@ -11,7 +11,7 @@ fn main() {
sysroot = sysroot.parent().unwrap();
}
let cg_clif_dylib_path = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join(
let cg_clif_dylib_path = sysroot.join("lib").join(
env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX,
);

View file

@ -11,7 +11,7 @@ fn main() {
sysroot = sysroot.parent().unwrap();
}
let cg_clif_dylib_path = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join(
let cg_clif_dylib_path = sysroot.join("lib").join(
env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX,
);