Skip to content

Adjust how native static libraries are linked#40504

Closed
retep998 wants to merge 1 commit intorust-lang:masterfrom
retep998:take-a-hint
Closed

Adjust how native static libraries are linked#40504
retep998 wants to merge 1 commit intorust-lang:masterfrom
retep998:take-a-hint

Conversation

@retep998
Copy link
Copy Markdown
Contributor

@retep998 retep998 commented Mar 14, 2017

Switch from link_whole_staticlib to link_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, including static-nobundle, not just static.

r? @alexcrichton
cc @vadimcn

Comment thread src/librustc_trans/back/link.rs Outdated
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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.

@retep998
Copy link
Copy Markdown
Contributor Author

Hmmmm, it looks like linking the whole staticlib is still necessary for librustc_llvm.

@alexcrichton
Copy link
Copy Markdown
Member

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.

@vadimcn
Copy link
Copy Markdown
Contributor

vadimcn commented Mar 14, 2017

Any reason to not always use an explicit export list? Are there linkers that do not support them?

@alexcrichton
Copy link
Copy Markdown
Member

Unsure, if we can get it to work then we can get it to work. Very little of src/librustc_trans/back/*.rs is anything beyond "this was the first thing that landed"

@alexcrichton
Copy link
Copy Markdown
Member

ping @retep998, any update on this?

@retep998
Copy link
Copy Markdown
Contributor Author

#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.

@alexcrichton
Copy link
Copy Markdown
Member

Ok, in the meantime I'm going to close this, but we can reopen/resubmit when tests are passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants