about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorRafael Rivera <rafael@withinwindows.com>2023-02-06 21:17:06 -0800
committerRafael Rivera <rafael@withinwindows.com>2023-02-06 21:17:06 -0800
commitc825e08571136deb5643ccd42bddf76b799ea93b (patch)
tree105089d487bbc50f957f72ad511167d5a9d400c4 /compiler/rustc_codegen_llvm
parent044a28a4091f2e1a5883f7fa990223f8b200a2cd (diff)
downloadrust-c825e08571136deb5643ccd42bddf76b799ea93b.tar.gz
rust-c825e08571136deb5643ccd42bddf76b799ea93b.zip
Specify dlltool prefix when generating import libs
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/archive.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs
index 58ca87524de..dd3268d7780 100644
--- a/compiler/rustc_codegen_llvm/src/back/archive.rs
+++ b/compiler/rustc_codegen_llvm/src/back/archive.rs
@@ -183,6 +183,12 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
             // able to control the *exact* spelling of each of the symbols that are being imported:
             // hence we don't want `dlltool` adding leading underscores automatically.
             let dlltool = find_binutils_dlltool(sess);
+            let temp_prefix = {
+                let mut path = PathBuf::from(&output_path);
+                path.pop();
+                path.push(lib_name);
+                path
+            };
             let result = std::process::Command::new(dlltool)
                 .args([
                     "-d",
@@ -192,6 +198,8 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
                     "-l",
                     output_path.to_str().unwrap(),
                     "--no-leading-underscore",
+                    "--temp-prefix",
+                    temp_prefix.to_str().unwrap(),
                 ])
                 .output();