Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upallocation functions exported when they shouldn't be #34493
Comments
retep998
changed the title
cdylib on windows msvc exports stuff from alloc and unwind crates
cdylib on windows msvc exports stuff from alloc and panic crates
Jun 27, 2016
This comment has been minimized.
This comment has been minimized.
|
All the symbols starting with The solution here would likely be to not tag these functions with |
steveklabnik
added
A-linkage
O-windows-msvc
labels
Jun 27, 2016
This comment has been minimized.
This comment has been minimized.
|
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. |
alexcrichton
removed
the
O-windows-msvc
label
Jul 4, 2016
alexcrichton
changed the title
cdylib on windows msvc exports stuff from alloc and panic crates
allocation functions exported when they shouldn't be
Jul 23, 2016
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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. |
alexcrichton
added
the
E-mentor
label
Jul 23, 2016
This comment has been minimized.
This comment has been minimized.
|
I'd be interested in looking at this if I could get a mentor. |
This comment has been minimized.
This comment has been minimized.
|
@c3st7n sure! If you need any help or pointers to get start just let me know |
retep998 commentedJun 27, 2016
•
edited
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