diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-07-25 19:53:17 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-07-30 10:10:41 +0000 |
| commit | ee89db9b172bf32bdf63bdcd841c4b3b8960ce0b (patch) | |
| tree | c3fd21c9d8d3fb3c62b16a95e013dcc295f5a1cc /compiler/rustc_codegen_llvm/src | |
| parent | ba5ff075323a546ac33679561f147d332629ec68 (diff) | |
| download | rust-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_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/archive.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs index 9a28428cb62..f8c767dea68 100644 --- a/compiler/rustc_codegen_llvm/src/back/archive.rs +++ b/compiler/rustc_codegen_llvm/src/back/archive.rs @@ -120,12 +120,8 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { sess: &Session, lib_name: &str, dll_imports: &[DllImport], - tmpdir: &Path, - is_direct_dependency: bool, - ) -> PathBuf { - let name_suffix = if is_direct_dependency { "_imports" } else { "_imports_indirect" }; - let output_path = tmpdir.join(format!("{lib_name}{name_suffix}.lib")); - + output_path: &Path, + ) { let target = &sess.target; let mingw_gnu_toolchain = common::is_mingw_gnu_toolchain(target); @@ -149,7 +145,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { // that loaded but crashed with an AV upon calling one of the imported // functions. Therefore, use binutils to create the import library instead, // by writing a .DEF file to the temp dir and calling binutils's dlltool. - let def_file_path = tmpdir.join(format!("{lib_name}{name_suffix}.def")); + let def_file_path = output_path.with_extension("def"); let def_file_content = format!( "EXPORTS\n{}", @@ -279,9 +275,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder { error: llvm::last_error().unwrap_or("unknown LLVM error".to_string()), }); } - }; - - output_path + } } } |
