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

Update notes about static linking and MUSL #224

Closed
wants to merge 1 commit into from

Conversation

joshtriplett
Copy link
Member

People often use the edition guide as general documentation of
capabilities, not just for Rust 2018. There is extensive information
on the web suggesting that Rust only supports static linking with
MUSL. Add a note documenting current capabilities, so that people know
they have a choice of libc implementations even if they need static
linking.

People often use the edition guide as general documentation of
capabilities, not just for Rust 2018. There is extensive information
on the web suggesting that Rust *only* supports static linking with
MUSL. Add a note documenting current capabilities, so that people know
they have a choice of libc implementations even if they need static
linking.
@joshtriplett
Copy link
Member Author

cc @estebank

@steveklabnik
Copy link
Member

Thanks @joshtriplett ! Just so you know, the current state of the edition RFC would be to remove the vast majority of the edition guide, and until that RFC is merged, I've effectively stopped work here entirely.

@joshtriplett
Copy link
Member Author

@steveklabnik That's fair, but until that change happens, I've seen people use and cite the edition guide as a reference for the capabilities of Rust. I don't mind if this text ends up deleted later to make way for something else. Would you consider merging it in the interim?

@Mark-Simulacrum
Copy link
Member

I think we shouldn't just remove the information -- I would like to see it put elsewhere (maybe something like a "Feature List" or whatever, not sure on naming), but regardless I agree that merging this in the interim makes sense to me. The reason we are thinking of dropping it from the Edition Guide in particular is that people were confused about whether the features were tied to a particular edition or not, I believe.

Comment on lines +5 to +6
(Note: current Rust (as of 1.48) supports static linking with either glibc or
MUSL, so you can select whichever libc you need or prefer.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it is 1.48? I thought static support is in 1.49 (rust-lang/rust#77386).

I would suggest being a little clearer here, and providing an example:

Suggested change
(Note: current Rust (as of 1.48) supports static linking with either glibc or
MUSL, so you can select whichever libc you need or prefer.)
> Note: Starting with Rust 1.49, the Linux glibc targets also support static
> linking the C runtime. This can be done with the [`+crt-static` target feature][crt-static].
> For example, with Cargo:
>
> ```console
> RUSTFLAGS="-C target-feature=+crt-static" cargo build --target x86_64-unknown-linux-gnu
> ```
[crt-static]: ../../../reference/linkage.html#static-and-dynamic-c-runtimes

I would also put this at the bottom of this section (just before ## Installing MUSL support).

@ehuss
Copy link
Contributor

ehuss commented Nov 23, 2020

I'm fine with minor updates until the fate of the guide is determined.

Also, in the future I would like to see platform-specific documentation added to the rustc book. I would like to see the https://doc.rust-lang.org/nightly/rustc/targets/index.html chapter include sub-chapters that go into detail on how to use each target, such as dependencies to install, peculiarities, etc.

@ehuss
Copy link
Contributor

ehuss commented Dec 26, 2020

Ping @joshtriplett Are you still interested in this?

@ehuss
Copy link
Contributor

ehuss commented May 25, 2021

Closing as this section has been removed in #232.

Similar to #178, ideally I think the rustc book should have documentation on the peculiarities of different targets. It has long been on my todo list, but alas never started. Hopefully at some point this information can be moved over there.

@ehuss ehuss closed this May 25, 2021
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