-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
allocation functions exported when they shouldn't be #34493
Comments
All the symbols starting with The solution here would likely be to not tag these functions with |
Right, so I hit this issue the hard way:
On the MSVC .dll the symbol is plain exported: you can link to it, load via GetProcAddress, it has entry address etc. On unix-like platforms, on the other hand, the symbol in question is undefined (i.e. imported):
as it should be. |
I've updated the title of this bug to indicate that it's not just Windows nor is it just cdylib. The solution I mentioned before may not be too hard to implement. I believe that the logic which decides to export these functions (for LTO at least) is here, and we probably can just add a whitelist of symbols that shouldn't be exported because they're just internal implementation details when compiling with LTO. cc @froydnj |
Also note that this "whitelist" should also consider symbols like:
It's basically the same thing there where once we have LTO none of them need to actually get exported all the way, just linked up. |
I'd be interested in looking at this if I could get a mentor. |
@c3st7n sure! If you need any help or pointers to get start just let me know |
Only the first two functions in that list should be there, the rest don't belong there.
Using
x86_64-pc-windows-msvc
.cc @alexcrichton
The text was updated successfully, but these errors were encountered: