Updating Rust's Linux musl targets

May 9, 2023 · Wesley Wiser on behalf of The Compiler Team

Beginning with Rust 1.71 (slated for stable release on 2023-07-13), the various *-linux-musl targets will ship with musl 1.2.3. These targets currently use musl 1.1.24. While musl 1.2.3 introduces some new features, most notably 64-bit time on all platforms, it is ABI compatible with earlier musl versions.

As such, this change is unlikely to affect you.

Updated targets

The following targets will be updated:

TargetSupport Tier
aarch64-unknown-linux-muslTier 2 with Host Tools
x86_64-unknown-linux-muslTier 2 with Host Tools
arm-unknown-linux-musleabiTier 2
arm-unknown-linux-musleabihfTier 2
armv5te-unknown-linux-musleabiTier 2
armv7-unknown-linux-musleabiTier 2
armv7-unknown-linux-musleabihfTier 2
i586-unknown-linux-muslTier 2
i686-unknown-linux-muslTier 2
mips-unknown-linux-muslTier 2
mips64-unknown-linux-muslabi64Tier 2
mips64el-unknown-linux-muslabi64Tier 2
mipsel-unknown-linux-muslTier 2
hexagon-unknown-linux-muslTier 3
mips64-openwrt-linux-muslTier 3
powerpc-unknown-linux-muslTier 3
powerpc64-unknown-linux-muslTier 3
powerpc64le-unknown-linux-muslTier 3
riscv32gc-unknown-linux-muslTier 3
riscv64gc-unknown-linux-muslTier 3
s390x-unknown-linux-muslTier 3
thumbv7neon-unknown-linux-musleabihfTier 3

Note: musl 1.2.3 does not raise the minimum required Linux kernel version for any target.

Will 64-bit time break the libc crate on 32-bit targets?

No, the musl project made this change carefully preserving ABI compatibility. The libc crate will continue to function correctly without modification.

A future version of the libc crate will update the definitions of time-related structures and functions to be 64-bit on all musl targets however this is blocked on the musl targets themselves first being updated. At present, there is no anticipated date when this change will take place and care will be taken to help the Rust ecosystem transition successfully to the updated time-related definitions.