Skip to content

Commit c825e08

Browse files
committed
Specify dlltool prefix when generating import libs
1 parent 044a28a commit c825e08

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_codegen_llvm/src/back/archive.rs

+8
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
183183
// able to control the *exact* spelling of each of the symbols that are being imported:
184184
// hence we don't want `dlltool` adding leading underscores automatically.
185185
let dlltool = find_binutils_dlltool(sess);
186+
let temp_prefix = {
187+
let mut path = PathBuf::from(&output_path);
188+
path.pop();
189+
path.push(lib_name);
190+
path
191+
};
186192
let result = std::process::Command::new(dlltool)
187193
.args([
188194
"-d",
@@ -192,6 +198,8 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
192198
"-l",
193199
output_path.to_str().unwrap(),
194200
"--no-leading-underscore",
201+
"--temp-prefix",
202+
temp_prefix.to_str().unwrap(),
195203
])
196204
.output();
197205

0 commit comments

Comments
 (0)