Rust currently has Tier 2 targets for a number of platforms using musl for libc (various flavors of ARM, MIPS and x86) as well as some Tier 3 targets (Hexagon, PowerPC, RISC-V, S390x and ARMv7 Thumb). Currently (most of) these targets statically link to musl libc during compilation. While that can be desirable to build fully functional statically linked binaries, this creates issues for musl based Linux distros which want to dynamically link libc. These issues have lead to a suboptimal experience for distro maintainers trying to bring Rust up in their distros.
This is the approach taken by rust-lang/rust#82556. It involves creating a new set of -dynmusl
targets which are dynamically linked.
Pros
-musl
targets.Cons
-musl
targets be dynamically linked as they would with other toolchains.-dynmusl
targets, for the same reason, but would accept them as a compromise.-musl
targets are not consistently static-linked. Some targets have dynamic linking instead.This is the alternate approach proposed as feedback to rust-lang/rust#82556. It involves changing the -musl
targets to be consistently dynamically linked.
Pros
-musl
targets would be more consistent (they are not right now as noted above), both internally and with other musl toolchains.-musl
targets to get reasonable (sometimes necessary - proc_macros
and graphics APIs require dynamic linking) behavior.rustup
) would functionally match what distros are shipping.Cons
-embmusl
(embedded musl) targets could also be added.The general consensus seems to be that we should update the existing musl targets to be dynamically linked.
When the -musl
port was first created for Rust, it was done to solve a specific use-case in the rust community: building compact redistributable binaries for Linux by statically-linking musl. However, the default settings for the -musl
targets are incompatible with the needs of distributions shipping rustc
and Rust software to their end users.
Unfortunately, for whatever reason, there was a lack of communication between musl-based distributions and the Rust team, which lead to the present situation where distributions have to modify the -musl
targets due to the defaults being unusable for them. A practical example is building Firefox on musl-based distributions, where the statically-linked output from rustc
is linked into a dynamic binary, leading to multiple independent copies of the libc linked into the program at runtime.
By changing the -musl
targets to behave like other targets (not defaulting to static linking), we get a set of -musl
targets that are analogous to any other musl toolchain. This solves the requirements of distributions and is likely less surprising to rustc
users who are not familiar with the quirks of the -musl
targets, at the expense of impacting -musl
target users who expect the static linking feature.
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing