Skip to content

Commit 0e8e9b3

Browse files
committed
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.
1 parent 916a0b3 commit 0e8e9b3

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

build_system/build_sysroot.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@ pub(crate) fn build_sysroot(
3333
let cg_clif_dylib_path = match cg_clif_dylib_src {
3434
CodegenBackend::Local(src_path) => {
3535
// Copy the backend
36-
let cg_clif_dylib_path = if cfg!(windows) {
37-
// Windows doesn't have rpath support, so the cg_clif dylib needs to be next to the
38-
// binaries.
39-
dist_dir.join("bin")
40-
} else {
41-
dist_dir.join("lib")
42-
}
43-
.join(src_path.file_name().unwrap());
36+
let cg_clif_dylib_path = dist_dir.join("lib").join(src_path.file_name().unwrap());
4437
try_hard_link(src_path, &cg_clif_dylib_path);
4538
CodegenBackend::Local(cg_clif_dylib_path)
4639
}

scripts/cargo-clif.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn main() {
1616
if let Some(name) = option_env!("BUILTIN_BACKEND") {
1717
rustflags.push(format!("-Zcodegen-backend={name}"));
1818
} else {
19-
let dylib = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join(
19+
let dylib = sysroot.join("lib").join(
2020
env::consts::DLL_PREFIX.to_string()
2121
+ "rustc_codegen_cranelift"
2222
+ env::consts::DLL_SUFFIX,

scripts/rustc-clif.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn main() {
1111
sysroot = sysroot.parent().unwrap();
1212
}
1313

14-
let cg_clif_dylib_path = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join(
14+
let cg_clif_dylib_path = sysroot.join("lib").join(
1515
env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX,
1616
);
1717

scripts/rustdoc-clif.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn main() {
1111
sysroot = sysroot.parent().unwrap();
1212
}
1313

14-
let cg_clif_dylib_path = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join(
14+
let cg_clif_dylib_path = sysroot.join("lib").join(
1515
env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX,
1616
);
1717

0 commit comments

Comments
 (0)