-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Adjust how native static libraries are linked #40504
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
Conversation
src/librustc_trans/back/link.rs
Outdated
// functions, etc. | ||
cmd.link_whole_staticlib(&l.name.as_str(), &search_path); | ||
} | ||
}).collect::<Vec<_>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for the collect
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, so I removed it.
Hmmmm, it looks like linking the whole staticlib is still necessary for librustc_llvm. |
Oh right, I don't think we past a list of symbols when creating dylibs on Unix platforms (only on Windows). For cdylibs I think we past the list on all platforms. |
Any reason to not always use an explicit export list? Are there linkers that do not support them? |
Unsure, if we can get it to work then we can get it to work. Very little of |
ping @retep998, any update on this? |
#40805 does the changes to hinting in a way which I think is better. It doesn't however attempt to switch from whole_staticlib to simply staticlib, so I'll investigate whether it is possible to use an explicit export list for dylibs everywhere. |
Ok, in the meantime I'm going to close this, but we can reopen/resubmit when tests are passing |
Switch from
link_whole_staticlib
tolink_staticlib
because we now pass explicit lists of what to export to the linker on all platforms so theoretically it should work.Ensure that
hint_static
is used appropriately for all static libraries, includingstatic-nobundle
, not juststatic
.r? @alexcrichton
cc @vadimcn