Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dlltool prefix hack #2019

Closed
glandium opened this issue Sep 13, 2022 · 1 comment · Fixed by #2052
Closed

Remove dlltool prefix hack #2019

glandium opened this issue Sep 13, 2022 · 1 comment · Fixed by #2052
Labels
enhancement New feature or request

Comments

@glandium
Copy link
Contributor

#1967 added a dlltool option (-t) to make the *_gnu import library member names more consistent across different versions of binutils. That required a sort of a hack to use a different prefix based on what the library name looked like, because of inconsistencies in the win32metadata. Those have since been fixed, so the hack can now be removed, which essentially looks like this:

diff --git a/crates/tools/gnu/src/main.rs b/crates/tools/gnu/src/main.rs
index aef4b96f9..e4bb99aba 100644
--- a/crates/tools/gnu/src/main.rs
+++ b/crates/tools/gnu/src/main.rs
@@ -109,11 +109,7 @@ EXPORTS
         });
         // Ensure consistency in the prefixes used by dlltool.
         cmd.arg("-t");
-        if library.contains('.') {
-            cmd.arg(format!("{}_", library).replace('.', "_").replace('-', "_"));
-        } else {
-            cmd.arg(format!("{}_dll_", library).replace('-', "_"));
-        }
+        cmd.arg(format!("{}_", library).replace('.', "_").replace('-', "_"));
     }
     cmd.output().unwrap();
 

Unfortunately, as is, this also generates different import libraries than what's in the repo because of what's now fixed in microsoft/win32metadata#1247.
So once there's a new metadata release and it's pulled in here, the above patch can be applied.

@kennykerr
Copy link
Collaborator

I believe this can now be fixed since #2050 has arrived.

@kennykerr kennykerr added enhancement New feature or request and removed blocked labels Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants