]> git.lizzy.rs Git - rust.git/commitdiff
Specify dlltool prefix when generating import libs
authorRafael Rivera <rafael@withinwindows.com>
Tue, 7 Feb 2023 05:17:06 +0000 (21:17 -0800)
committerRafael Rivera <rafael@withinwindows.com>
Tue, 7 Feb 2023 05:17:06 +0000 (21:17 -0800)
compiler/rustc_codegen_llvm/src/back/archive.rs

index 58ca87524deb69d891cc1dbfe8c953de5cdc4b95..dd3268d7780c6acdc18a7a537e17d5b340dbb9c3 100644 (file)
@@ -183,6 +183,12 @@ fn create_dll_import_lib(
             // 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 @@ fn create_dll_import_lib(
                     "-l",
                     output_path.to_str().unwrap(),
                     "--no-leading-underscore",
+                    "--temp-prefix",
+                    temp_prefix.to_str().unwrap(),
                 ])
                 .output();