-
Notifications
You must be signed in to change notification settings - Fork 709
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
Add support for statically-linked musl libc Linux targets (-unknown-linux-musl) #713
Comments
Why is removing the |
FYI - from updates on rust-lang/libc#659, |
More discussion in #935 |
@aig787's PR #1067 added the -musl targets for Linux x86_64 and i686 to CI/CD. Still to do:
|
See also rust-lang/cc-rs#165. We should have a step in CI/CD that verifies that we support PIE correctly. |
I attempted to remove the gcc-multilib dependency but the build fails with:
I doubt using gcc-multilib with musl is the right thing to do but I could be convinced otherwise. I'll try experimenting with using - Help understanding and/or resolving this is appreciated. Otherwise, maybe this is a good motivation to get rid of all the remaining C code in ring. |
I did the experiment and that seems like it will work fine. I actually had done the same something similar for wasm32-unknown already and I verified that the same works for musl, without gcc-multilib and libc6-dev-i386. I need to clean up the experiment before creating a PR for it. |
PR #1118 makes progress here; see that PR for details. Remaining work to be done:
|
PR #1133 shows how to use |
Hi, |
Are you then using the |
No flags are used, the build command is as simple as Are those flags special |
cc-rs will automatically use the musl tools (musl-cc) by default, so if you are happy with using musl-tools, then you will get the correct results. If you want to use clang and rust-lld and "self contained" linking instead, then you do have to set up some things as described in ring's mk/cargo.sh. Maybe I should change ring's CI/CD to test the "Just use the defaults" code path. |
Just want to add that if static linking is the only cencern, I'm able to produce a static linked binary using |
Hi @briansmith, any news on this issue? |
This has been working for a long time, AFAICT. We have aarch64-unknown-linux-musl, armv7-unknown-linux-musleabihf, i686-unknown-linux-musl, and x86_64-unknown-linux-musl tested in every CI run. |
No description provided.
The text was updated successfully, but these errors were encountered: