-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Don't bundle static libc. #1327
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Ping me when CI is green. |
710342c
to
f8040dc
Compare
Ping. |
cc @alexcrichton this LGTM, but it makes me wonder why don't we always use |
This PR would unfortunately break both these targets as distributed with rust-lang/rust. The usage of |
@alexcrichton I'm not sure I understand. So we don't ship the C library with rustup, so that it is just linked like a normal library when linking the binary, but we statically link it and "bundle it" into the libc rlib distributed with rustc ? If so, does static linking here bundle the whole C library, or only what libc exposes? Also, |
Yes, linking with |
So one more thing. How does cross compiling for a |
I think it just basically doesn't work, building a fully linked binary with |
I don't see how musl is that different from glibc, uclibc, or dietlibc. Shouldn't something like |
IIUC glibc is dynamically linked, while musl appears to be always statically linked. I suppose that if we were to statically link glibc, then we'd have a similar issue. |
Not necessarily. My platform does not support static linking and uses musl. |
And when compiling with rustc musl gets dynamically linked? Which target triple is that? (I thought rustc always statically linked musl for the musl targets). |
A slightly modified |
@alexcrichton to support that it might make sense to move the logic of whether musl is statically or dynamically linked to the target specification file. |
Isn't the |
Dealing with crt linkage on musl is basically an endless world of pain unfortunately in what we have set up in rustc. It's all workable one way or another but it's very meticulously crafted right now and I would discourage large changes without having a fuller picture of what's happening. |
I agree with you. I've opened a new issue at rust-lang/rfcs#2695. I'd like to hear your suggestions about how to deal with this. |
I can be around to answer questions from time to time, but I do not have the time to help design a new system and or help architect changes. |
I think that the fix here would be to just set |
Such |
@hvenev I'm closing this, I think that the next step here is to design a solution in rust-lang/rust for how to support both statically and dynamically-linked musl targets. And then propose a combined set of patches that implements support for this in rustc and libc, without breaking the statically linked musl targets that we already support. @hvenev it seems that rust-lang/rust#59302 is a good place to discuss and organize work around this. |
Posted a plan for the fixing this in rustc repo rust-lang/rust#72274. |
No description provided.