Repository navigation
build: Restructure time64 config - #5508
Merged
Merged
Conversation
tgross35
force-pushed
the
build-updates
branch
4 times, most recently
from
September 7, 2026 08:00
3ced9ca to
f0646b9
Compare
tgross35
marked this pull request as ready for review
September 7, 2026 08:08
MUSL_REDIR_TIME64_ARCHES are just the 32-bit arches that aren't 1.2-only, i.e. the opposite of the 32-bit arches that always set `musl_v1_2 = true`. Merge the logic for these two. riscv32 is added to this list since it is in the same boat. Additionally, restructure things to make the logic flow more clear.
tgross35
force-pushed
the
build-updates
branch
from
September 7, 2026 08:09
b93c298 to
3d2481e
Compare
tgross35
enabled auto-merge
September 7, 2026 08:10
This was referenced Sep 7, 2026
Merged
renovate-bot
pushed a commit
to renovate-bot/rust-lang-_-libc
that referenced
this pull request
Sep 17, 2026
MUSL_REDIR_TIME64_ARCHES are just the 32-bit arches that aren't 1.2-only, i.e. the opposite of the 32-bit arches that always set `musl_v1_2 = true`. Merge the logic for these two. riscv32 is added to this list since it is in the same boat. Additionally, restructure things to make the logic flow more clear. (backport <rust-lang#5508>) (cherry picked from commit 4042869)
renovate-bot
pushed a commit
to renovate-bot/rust-lang-_-libc
that referenced
this pull request
Sep 17, 2026
(backport <rust-lang#5508>) (cherry picked from commit 008f905)
kraj
added a commit
to YoeDistro/openembedded-core
that referenced
this pull request
Oct 22, 2026
musl on riscv32 only has a 64-bit time_t. The libc crate before 0.2.190 still uses 32-bit time_t struct layouts for riscv32 musl unless asked otherwise, so e.g. std's stat() passes a struct stat that is about 24 bytes smaller than the 128 bytes musl writes. This corrupts the stack, and any Rust program calling std::thread::available_parallelism() or std::fs::metadata() crashes: qemu: uncaught target signal 11 (Segmentation fault) - core dumped This affects std, which uses the vendored libc 0.2.189 in Rust 1.99.0, as well as crates using older libc versions. Upstream fixed it in libc 0.2.190 by always using the musl 1.2 layouts on riscv32 [1]. Until then, opt into them for riscv32 musl targets: libc 0.2.174 to 0.2.188 read the RUST_LIBC_UNSTABLE_MUSL_V1_2_3 environment variable, 0.2.189 the libc_unstable_musl_v1_2_3 cfg. Older versions have no musl time64 support. [1] rust-lang/libc#5508 Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
kraj
added a commit
to YoeDistro/openembedded-core
that referenced
this pull request
Oct 22, 2026
musl on riscv32 only has a 64-bit time_t. The libc crate before 0.2.190 still uses 32-bit time_t struct layouts for riscv32 musl unless asked otherwise, so e.g. std's stat() passes a struct stat that is about 24 bytes smaller than the 128 bytes musl writes. This corrupts the stack, and any Rust program calling std::thread::available_parallelism() or std::fs::metadata() crashes: qemu: uncaught target signal 11 (Segmentation fault) - core dumped This affects std, which uses the vendored libc 0.2.189 in Rust 1.99.0. Upstream fixed it in libc 0.2.190 by always using the musl 1.2 layouts on riscv32 [1]. Until then, opt into them for riscv32 musl targets with the libc_unstable_musl_v1_2_3 cfg, which libc 0.2.189 reads. Earlier versions are not opted in: 0.2.174 to 0.2.188 read the RUST_LIBC_UNSTABLE_MUSL_V1_2_3 environment variable instead, but their riscv32 time64 layouts lack the timespec padding (up to 0.2.182) or fail to build with duplicate __pad1/__pad2 fields (0.2.183 to 0.2.188), and older versions have no musl time64 support. [1] rust-lang/libc#5508 Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
kraj
added a commit
to YoeDistro/openembedded-core
that referenced
this pull request
Oct 22, 2026
musl on riscv32 only has a 64-bit time_t. The libc crate before 0.2.190 still uses 32-bit time_t struct layouts for riscv32 musl unless asked otherwise, so e.g. std's stat() passes a struct stat that is about 24 bytes smaller than the 128 bytes musl writes. This corrupts the stack, and any Rust program calling std::thread::available_parallelism() or std::fs::metadata() crashes: qemu: uncaught target signal 11 (Segmentation fault) - core dumped This affects std, which uses the vendored libc 0.2.189 in Rust 1.99.0. Upstream fixed it in libc 0.2.190 by always using the musl 1.2 layouts on riscv32 [1]. Until then, opt into them for riscv32 musl targets with the libc_unstable_musl_v1_2_3 cfg, which libc 0.2.189 reads. Earlier versions are not opted in: 0.2.174 to 0.2.188 read the RUST_LIBC_UNSTABLE_MUSL_V1_2_3 environment variable instead, but their riscv32 time64 layouts lack the timespec padding (up to 0.2.182) or fail to build with duplicate __pad1/__pad2 fields (0.2.183 to 0.2.188), and older versions have no musl time64 support. [1] rust-lang/libc#5508 Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
halstead
pushed a commit
to openembedded/openembedded-core
that referenced
this pull request
Oct 26, 2026
musl on riscv32 only has a 64-bit time_t. The libc crate before 0.2.190 still uses 32-bit time_t struct layouts for riscv32 musl unless asked otherwise, so e.g. std's stat() passes a struct stat that is about 24 bytes smaller than the 128 bytes musl writes. This corrupts the stack, and any Rust program calling std::thread::available_parallelism() or std::fs::metadata() crashes: qemu: uncaught target signal 11 (Segmentation fault) - core dumped This affects std, which uses the vendored libc 0.2.189 in Rust 1.99.0. Upstream fixed it in libc 0.2.190 by always using the musl 1.2 layouts on riscv32 [1]. Until then, opt into them for riscv32 musl targets with the libc_unstable_musl_v1_2_3 cfg, which libc 0.2.189 reads. Earlier versions are not opted in: 0.2.174 to 0.2.188 read the RUST_LIBC_UNSTABLE_MUSL_V1_2_3 environment variable instead, but their riscv32 time64 layouts lack the timespec padding (up to 0.2.182) or fail to build with duplicate __pad1/__pad2 fields (0.2.183 to 0.2.188), and older versions have no musl time64 support. [1] rust-lang/libc#5508 Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.