about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-15 18:30:04 +0000
committerbors <bors@rust-lang.org>2023-03-15 18:30:04 +0000
commitab654863c3d50482f260cf862647f1fe0ff5e010 (patch)
tree3bc5c4bcc605bd641f5dd53a4b589cebd57b0139 /compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs
parenta167cbddac2b9f9bb6fde0cf22473115958a8358 (diff)
parentfce629d2e9eddd957411caa5fed0e1146c745bd8 (diff)
downloadrust-ab654863c3d50482f260cf862647f1fe0ff5e010.tar.gz
rust-ab654863c3d50482f260cf862647f1fe0ff5e010.zip
Auto merge of #109169 - bjorn3:sync_cg_clif-2023-03-15, r=bjorn3
Sync rustc_codegen_cranelift

Bunch of bug fixes this time. Also an update to Cranelift 0.93 which adds a brand new optimization pass which cg_clif exposes when using `--release`. And various improvements to cg_clif's test suite, making it faster to run. And finally two small perf improvements.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
Diffstat (limited to 'compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs b/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs
index a6528ac41ae..167631eaf7e 100644
--- a/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs
+++ b/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs
@@ -2,11 +2,14 @@ use std::env;
 use std::ffi::OsString;
 #[cfg(unix)]
 use std::os::unix::process::CommandExt;
-use std::path::PathBuf;
 use std::process::Command;
 
 fn main() {
-    let sysroot = PathBuf::from(env::current_exe().unwrap().parent().unwrap());
+    let current_exe = env::current_exe().unwrap();
+    let mut sysroot = current_exe.parent().unwrap();
+    if sysroot.file_name().unwrap().to_str().unwrap() == "bin" {
+        sysroot = sysroot.parent().unwrap();
+    }
 
     let cg_clif_dylib_path = sysroot.join(if cfg!(windows) { "bin" } else { "lib" }).join(
         env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX,