about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-07-25 19:53:17 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-07-30 10:10:41 +0000
commitee89db9b172bf32bdf63bdcd841c4b3b8960ce0b (patch)
treec3fd21c9d8d3fb3c62b16a95e013dcc295f5a1cc /compiler/rustc_codegen_ssa/src/back
parentba5ff075323a546ac33679561f147d332629ec68 (diff)
downloadrust-ee89db9b172bf32bdf63bdcd841c4b3b8960ce0b.tar.gz
rust-ee89db9b172bf32bdf63bdcd841c4b3b8960ce0b.zip
Move temp file name generation out of the create_dll_import_lib method
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/archive.rs5
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs10
2 files changed, 9 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs
index fd39ef2649b..b4ee6514b04 100644
--- a/compiler/rustc_codegen_ssa/src/back/archive.rs
+++ b/compiler/rustc_codegen_ssa/src/back/archive.rs
@@ -31,9 +31,8 @@ pub trait ArchiveBuilderBuilder {
         sess: &Session,
         lib_name: &str,
         dll_imports: &[DllImport],
-        tmpdir: &Path,
-        is_direct_dependency: bool,
-    ) -> PathBuf;
+        output_path: &Path,
+    );
 
     fn extract_bundled_libs<'a>(
         &'a self,
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 730d1ff73a0..4bdaeaf2996 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -494,13 +494,17 @@ fn create_dll_import_libs<'a>(
     Ok(collate_raw_dylibs(sess, used_libraries)?
         .into_iter()
         .map(|(raw_dylib_name, raw_dylib_imports)| {
+            let name_suffix = if is_direct_dependency { "_imports" } else { "_imports_indirect" };
+            let output_path = tmpdir.join(format!("{raw_dylib_name}{name_suffix}.lib"));
+
             archive_builder_builder.create_dll_import_lib(
                 sess,
                 &raw_dylib_name,
                 &raw_dylib_imports,
-                tmpdir,
-                is_direct_dependency,
-            )
+                &output_path,
+            );
+
+            output_path
         })
         .collect())
 }