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

improved handling of static libraries list #313

Open
jsha opened this issue Mar 29, 2023 · 0 comments
Open

improved handling of static libraries list #313

jsha opened this issue Mar 29, 2023 · 0 comments

Comments

@jsha
Copy link
Collaborator

jsha commented Mar 29, 2023

When we produce a library, it relies on a number of symbols that come from other libraries we expect to link against. For instance, on Linux our library should be linked with:

-lrustls -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc

Mainly these dependencies come from the Rust standard library, which, for instance, requires pthread for its threading capabilities. I believe they can also come from our set of transitive dependencies (need to check).

We can get this list of libraries from rustc --print native-static-libs.

We document the list in our README, and have a test that it remains up-to-date across rustc versions. Across recent rustc releases, that test has flapped a bit, particularly with the inclusion / un-inclusion of legacy_stdio_definitions.lib (which occurs in two places in the linking list for Windows).

We should run --print native-static-libs across several recent rustc versions and see how its value has changed, particularly with an eye towards how it affects MSRV. Also it's worth noting: in my experience not all of the listed libraries are actually required to link rustls; it's a conservative set. So for instance we could start explicitly ignoring certain of them.

We should also check the issue / PR history for rustc and maybe file an issue to better understand whether legacy_stdio_definitions is meant to be included, and in what position(s).

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

No branches or pull requests

1 participant