Skip to content

Commit dcf4b8b

Browse files
committed
cleanup and update
1 parent 712e9a8 commit dcf4b8b

File tree

1 file changed

+67
-27
lines changed

1 file changed

+67
-27
lines changed

content/Updating-musl-1.2.5.md

Lines changed: 67 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,57 +11,97 @@ team_url = "https://www.rust-lang.org/governance/teams/compiler"
1111

1212
# Updating Rust's Linux musl targets to 1.2.5
1313

14-
Beginning with Rust 1.90 (slated for stable release on 2025-09-18), the various `*-linux-musl` targets will [ship](https://github.com/rust-lang/rust/pull/142682) with musl 1.2.5. These targets currently use musl 1.2.3. This update comes with [several fixes and improvements](https://musl.libc.org/releases.html), and a breaking change that affects the Rust ecosystem.
14+
Beginning with Rust 1.93 (slated for stable release on 2026-01-22), the various `*-linux-musl` targets will all [ship](https://github.com/rust-lang/rust/pull/142682) with musl 1.2.5. This primarily affects static musl builds for `x86_64`, `aarch64`, and `powerpc64le` which bundled musl 1.2.3. This update comes with [several fixes and improvements](https://musl.libc.org/releases.html), and a breaking change that affects the Rust ecosystem.
1515

1616
For the Rust ecosystem, the primary motivation for this update is to receive major improvements to musl's DNS resolver which shipped in 1.2.4 and received bug fixes in 1.2.5. When using `musl` targets for static linking, this should make portable linux binaries that do networking more reliable, particularly in the face of large DNS records and recursive nameservers.
1717

1818
However, 1.2.4 also comes with a breaking change: [the removal of several legacy compatibility symbols that the Rust libc crate was using](https://github.com/rust-lang/libc/issues/2934). A fix for this [was shipped in libc 0.2.146 in June 2023 (2 years ago)](https://github.com/rust-lang/libc/pull/2935), and we have been waiting for newer versions of the libc crate to propagate throughout the ecosystem before shipping the musl update.
1919

20-
A crater run in July 2024 (a year ago) [found only about 2% of rust projects were still affected](https://github.com/rust-lang/rust/pull/125692#issuecomment-2245182085). At this point we expect there will be minimal breakage, and most breakage should be resolved by a `cargo update`. We believe this update shouldn't be held back any longer, as it contains critical fixes for the musl target.
20+
A crater run in July 2024 found only about 2.4% of Rust projects were still affected. [A crater run in June 2025 found 1.5% of Rust projects were affected](https://github.com/rust-lang/rust/pull/142682#issuecomment-3002514461). Most of that change is from crater analyzing More Rust Projects. The absolute amount of broken projects went down by 15% while the absolute amount of analyzed projects went up by 35%.
21+
22+
At this point we expect there will be minimal breakage, and most breakage should be resolved by a `cargo update`. We believe this update shouldn't be held back any longer, as it contains critical fixes for the musl target.
23+
24+
Manual inspection of some of the affected projects indicates they largely haven't run `cargo update` in 2 years, often because they haven't had any changes in 2 years. Analysis suggests this Rust release will be a devastating blow to the thriving ecosystem of Rust gamedev projects that you started 3 years ago and will definitely get back to this year.
25+
26+
Build failures from this change will typically look like "some \`extern\` functions couldn't be found; some native libraries may need to be installed or have their path specified", often specifically for "undefined reference to \`open64'", often while trying to build very old versions of the `getrandom` crate (hence the decimation of abandoned gamedev projects in particular):
27+
28+
<details><summary>Example Build Failure</summary>
29+
30+
```
31+
[INFO] [stderr] Compiling guess_the_number v0.1.0 (/opt/rustwide/workdir)
32+
[INFO] [stdout] error: linking with `cc` failed: exit status: 1
33+
[INFO] [stdout] |
34+
[INFO] [stdout] = note: "cc" "-m64" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/rcrt1.o" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crti.o" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtbeginS.o" "/tmp/rustcMZMWZW/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/opt/rustwide/target/x86_64-unknown-linux-musl/debug/deps/{librand-bff7d8317cf08aa0.rlib,librand_chacha-612027a3597e9138.rlib,libppv_lite86-742ade976f63ace4.rlib,librand_core-be9c132a0f2b7897.rlib,libgetrandom-dc7f0d82f4cb384d.rlib,liblibc-abed7616303a3e0d.rlib,libcfg_if-66d55f6b302e88c8.rlib}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*}.rlib" "-lunwind" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/{libcfg_if-*,liblibc-*}.rlib" "-lc" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/{librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-L" "/tmp/rustcMZMWZW/raw-dylibs" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-nostartfiles" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib" "-o" "/opt/rustwide/target/x86_64-unknown-linux-musl/debug/deps/guess_the_number-41a068792b5f051e" "-Wl,--gc-sections" "-static-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtendS.o" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtn.o"
35+
[INFO] [stdout] = note: some arguments are omitted. use `--verbose` to show all linker arguments
36+
[INFO] [stdout] = note: /usr/bin/ld: /opt/rustwide/target/x86_64-unknown-linux-musl/debug/deps/libgetrandom-dc7f0d82f4cb384d.rlib(getrandom-dc7f0d82f4cb384d.getrandom.828c5c30a8428cf4-cgu.0.rcgu.o): in function `getrandom::util_libc::open_readonly':
37+
[INFO] [stdout] /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.2.8/src/util_libc.rs:150:(.text._ZN9getrandom9util_libc13open_readonly17hdc55d6ead142a889E+0xbc): undefined reference to `open64'
38+
[INFO] [stdout] collect2: error: ld returned 1 exit status
39+
[INFO] [stdout]
40+
[INFO] [stdout] = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
41+
[INFO] [stdout] = note: use the `-l` flag to specify native libraries to link
42+
[INFO] [stdout] = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
43+
[INFO] [stdout]
44+
[INFO] [stdout]
45+
[INFO] [stderr] error: could not compile `guess_the_number` (bin "guess_the_number") due to 1 previous error
46+
```
47+
48+
</details>
49+
50+
2151

2252
# Updated targets
2353

24-
The following targets will be updated (this is just "all musl targets except [`loongarch64-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/loongarch-linux.html) which already was on 1.2.5, and [WALI](https://github.com/arjunr2/WALI) which doesn't use our bundled musl"):
54+
All Rust musl targets that bundle a copy of musl now bundle 1.2.5. All Rust musl targets now require musl 1.2.5 at a minimum.
55+
56+
The mostly only actually impacts the three "Tier 2 With Host Tools" musl targets which were pinned to musl 1.2.3:
57+
* `aarch64-unknown-linux-musl`
58+
* `x86_64-unknown-linux-musl`
59+
* `powerpc64le-unknown-linux-musl`
60+
61+
The fourth target at this level of support, `loongarch64-unknown-linux-musl`, is so new that it was always on musl 1.2.5.
62+
63+
[Due to an apparent configuration oversight with `crosstool-ng`](https://github.com/rust-lang/rust/pull/142682#issuecomment-3358724267), all other targets were already bundling musl 1.2.5. These targets were [silently upgraded to musl 1.2.4 in Rust 1.74.0](https://github.com/rust-lang/rust/commit/f99fdac3df5f97287857786bcce9660250009cbf) and [silently upgraded to musl 1.2.5 in Rust 1.86](https://github.com/rust-lang/rust/commit/ed2823c6efec9845d6e35ee7717f2e65099ab1c2). This oversight has been rectified and all targets have been pinned to musl 1.2.5 to prevent future silent upgrades (but hey, no one noticing bodes well for the ecosystem impact of this change). Their documentation has now been updated to reflect the fact that bundling 1.2.5 is actually intentional, and that 1.2.5 is now considered a minimum requirement.
2564

65+
Here are all the updated definitions:
2666

2767
## Tier 2 with Host Tools
2868

2969
target | notes
3070
-------|-------
31-
`aarch64-unknown-linux-musl` | ARM64 Linux with musl 1.2.3
32-
[`powerpc64le-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/powerpc64le-unknown-linux-musl.html) | PPC64LE Linux (kernel 4.19, musl 1.2.3)
33-
[`riscv64gc-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/riscv64gc-unknown-linux-musl.html) | RISC-V Linux (kernel 4.20, musl 1.2.3)
34-
`x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.3
71+
[`aarch64-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/aarch64-unknown-linux-musl.html) | ARM64 Linux with musl 1.2.5
72+
[`powerpc64le-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/powerpc64le-unknown-linux-musl.html) | PPC64LE Linux (kernel 4.19, musl 1.2.5)
73+
`x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.5
3574

3675

3776
## Tier 2 without Host Tools
3877

3978

4079
target | std | notes
4180
-------|:---:|-------
42-
`arm-unknown-linux-musleabi` | ✓ | Armv6 Linux with musl 1.2.3
43-
`arm-unknown-linux-musleabihf` | ✓ | Armv6 Linux with musl 1.2.3, hardfloat
44-
`armv5te-unknown-linux-musleabi` | ✓ | Armv5TE Linux with musl 1.2.3
45-
`armv7-unknown-linux-musleabi` | ✓ | Armv7-A Linux with musl 1.2.3
46-
`armv7-unknown-linux-musleabihf` | ✓ | Armv7-A Linux with musl 1.2.3, hardfloat
47-
`i586-unknown-linux-musl` | ✓ | 32-bit Linux (musl 1.2.3, original Pentium)
48-
`i686-unknown-linux-musl` | ✓ | 32-bit Linux with musl 1.2.3 (Pentium 4)
81+
`arm-unknown-linux-musleabi` | ✓ | Armv6 Linux with musl 1.2.5
82+
`arm-unknown-linux-musleabihf` | ✓ | Armv6 Linux with musl 1.2.5, hardfloat
83+
`armv5te-unknown-linux-musleabi` | ✓ | Armv5TE Linux with musl 1.2.5
84+
`armv7-unknown-linux-musleabi` | ✓ | Armv7-A Linux with musl 1.2.5
85+
`armv7-unknown-linux-musleabihf` | ✓ | Armv7-A Linux with musl 1.2.5, hardfloat
86+
`i586-unknown-linux-musl` | ✓ | 32-bit Linux (musl 1.2.5, original Pentium)
87+
`i686-unknown-linux-musl` | ✓ | 32-bit Linux with musl 1.2.5 (Pentium 4)
88+
[`riscv64gc-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/riscv64gc-unknown-linux-musl.html) | RISC-V Linux (kernel 4.20+, musl 1.2.5)
4989

5090
## Tier 3
5191

5292

5393
target | std | host | notes
5494
-------|:---:|:----:|-------
55-
[`hexagon-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/hexagon-unknown-linux-musl.html) | ✓ | | Hexagon Linux with musl 1.2.3
56-
`mips-unknown-linux-musl` | ✓ | | MIPS Linux with musl 1.2.3
57-
[`mips64-openwrt-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/mips64-openwrt-linux-musl.html) | ? | | MIPS64 for OpenWrt Linux musl 1.2.3
58-
`mips64-unknown-linux-muslabi64` | ✓ | | MIPS64 Linux, N64 ABI, musl 1.2.3
59-
`mips64el-unknown-linux-muslabi64` | ✓ | | MIPS64 (little endian) Linux, N64 ABI, musl 1.2.3
60-
`mipsel-unknown-linux-musl` | ✓ | | MIPS (little endian) Linux with musl 1.2.3
61-
`powerpc-unknown-linux-musl` | ? | | PowerPC Linux with musl 1.2.3
62-
[`powerpc-unknown-linux-muslspe`](https://doc.rust-lang.org/rustc/platform-support/powerpc-unknown-linux-muslspe.html) | ? | | PowerPC SPE Linux with musl 1.2.3
63-
[`powerpc64-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/powerpc64-unknown-linux-musl.html) | ✓ | ✓ | PPC64 Linux (kernel 4.19, musl 1.2.3)
64-
`riscv32gc-unknown-linux-musl` | ? | | RISC-V Linux (kernel 5.4, musl 1.2.3 + RISCV32 support patches)
65-
[`s390x-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/s390x-unknown-linux-musl.html) | ✓ | | S390x Linux (kernel 3.2, musl 1.2.3)
66-
`thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode Armv7-A Linux with NEON, musl 1.2.3
67-
[`x86_64-unikraft-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/unikraft-linux-musl.html) | ✓ | | 64-bit Unikraft with musl 1.2.3
95+
[`hexagon-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/hexagon-unknown-linux-musl.html) | ✓ | | Hexagon Linux with musl 1.2.5
96+
`mips-unknown-linux-musl` | ✓ | | MIPS Linux with musl 1.2.5
97+
[`mips64-openwrt-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/mips64-openwrt-linux-musl.html) | ? | | MIPS64 for OpenWrt Linux musl 1.2.5
98+
`mips64-unknown-linux-muslabi64` | ✓ | | MIPS64 Linux, N64 ABI, musl 1.2.5
99+
`mips64el-unknown-linux-muslabi64` | ✓ | | MIPS64 (little endian) Linux, N64 ABI, musl 1.2.5
100+
`mipsel-unknown-linux-musl` | ✓ | | MIPS (little endian) Linux with musl 1.2.5
101+
`powerpc-unknown-linux-musl` | ? | | PowerPC Linux with musl 1.2.5
102+
[`powerpc-unknown-linux-muslspe`](https://doc.rust-lang.org/rustc/platform-support/powerpc-unknown-linux-muslspe.html) | ? | | PowerPC SPE Linux with musl 1.2.5
103+
[`powerpc64-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/powerpc64-unknown-linux-musl.html) | ✓ | ✓ | PPC64 Linux (kernel 4.19, musl 1.2.5)
104+
`riscv32gc-unknown-linux-musl` | ? | | RISC-V Linux (kernel 5.4, musl 1.2.5 + RISCV32 support patches)
105+
[`s390x-unknown-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/s390x-unknown-linux-musl.html) | ✓ | | S390x Linux (kernel 3.2, musl 1.2.5)
106+
`thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode Armv7-A Linux with NEON, musl 1.2.5
107+
[`x86_64-unikraft-linux-musl`](https://doc.rust-lang.org/rustc/platform-support/unikraft-linux-musl.html) | ✓ | | 64-bit Unikraft with musl 1.2.5

0 commit comments

Comments
 (0)