about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-04-29 12:00:43 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2023-04-29 12:00:43 +0000
commita8697f95659dae497c30f5ee4b73badd271cf77d (patch)
tree0a438b657b7dd8ef2b68629ff16be26fd873a3a0 /compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs
parentf2299490c11b0c53ece5f6a13dd092fc9c99d264 (diff)
parentef07e8e60f994ec014d049a95591426fb92ebb79 (diff)
downloadrust-a8697f95659dae497c30f5ee4b73badd271cf77d.tar.gz
rust-a8697f95659dae497c30f5ee4b73badd271cf77d.zip
Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into sync_cg_clif-2023-04-29
Diffstat (limited to 'compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs b/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs
index b9bba7f2e08..ab496a4a684 100644
--- a/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs
+++ b/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs
@@ -15,22 +15,24 @@ fn main() {
         env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX,
     );
 
-    let mut args = std::env::args_os().skip(1).collect::<Vec<_>>();
+    let passed_args = std::env::args_os().skip(1).collect::<Vec<_>>();
+    let mut args = vec![];
     args.push(OsString::from("-Cpanic=abort"));
     args.push(OsString::from("-Zpanic-abort-tests"));
     let mut codegen_backend_arg = OsString::from("-Zcodegen-backend=");
     codegen_backend_arg.push(cg_clif_dylib_path);
     args.push(codegen_backend_arg);
-    if !args.contains(&OsString::from("--sysroot")) {
+    if !passed_args.contains(&OsString::from("--sysroot")) {
         args.push(OsString::from("--sysroot"));
         args.push(OsString::from(sysroot.to_str().unwrap()));
     }
+    args.extend(passed_args);
 
     // Ensure that the right toolchain is used
     env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME"));
 
     #[cfg(unix)]
-    Command::new("rustc").args(args).exec();
+    panic!("Failed to spawn rustc: {}", Command::new("rustc").args(args).exec());
 
     #[cfg(not(unix))]
     std::process::exit(