-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
[WIP] rustc_target: Remove crt_static_respected
and crt_static_allows_dylibs
#70501
Conversation
…libs` Always respect `+crt-static` option if user passed it.
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
For some background: I needed to produce some library usable in a restricted environment requiring no dynamically linked libc (a binary instrumentation system), this is an issue I immediately encountered when attempting to do it in Rust instead of C/C++. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Hmm, this setup may break though if |
I don't have resources to pursue this, unfortunately, and I needed this yesterday rather than in few months in the future. The workaround is to produce a |
Always respect
+crt-static
option if user passed it.If the user wants to link to e.g. bionic or glibc statically,
rustc
should at least not stay in the way.Linking to libc statically may require linking some startup files as well or passing extra linker options.
For some targets like
*-musl
rustc
supports doing it implicitly.For other targets it's responsibility of the user passing
+crt-static
to link them using-C (pre-)link-args
and similar flags.cc rust-lang/libc#1711 #40113 #70095