Repository navigation
[0.2] Backports - #5581
Merged
Merged
[0.2] Backports#5581
Conversation
This is a tier 2 with host tools target since 1.99. (backport <rust-lang#5527>) (cherry picked from commit 33a18fd)
glibc defines this, musl has no idea what it is. (backport <rust-lang#5527>) (cherry picked from commit 6a39a50)
See also https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits/signal.h#n38 (backport <rust-lang#5527>) (cherry picked from commit ecb0e0d)
https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits/signal.h#n67 (backport <rust-lang#5527>) (cherry picked from commit 4086aaf)
riscv64 musl uses the generic definition of ipc_perm found here: https://git.musl-libc.org/cgit/musl/tree/arch/generic/bits/ipc.h (backport <rust-lang#5527>) (cherry picked from commit 49863e1)
https://git.musl-libc.org/cgit/musl/tree/arch/riscv64/bits/syscall.h.in#n305 (backport <rust-lang#5527>) (cherry picked from commit 00f5e5c)
The musl implementation doesn't call it `__glibc_reserved`. [ note: I also marked this field private to match `main` since it's a more recent target, and nobody should be accessing it anyway - Trevor ] (backport <rust-lang#5533>) (cherry picked from commit 35c8b7d)
Skip AIX targets from CI tests while rust-lang/rust#162979 gets sorted out. (backport <rust-lang#5541>) (cherry picked from commit d770f3e)
`linux_time_bits64` should correlate to the kernel's `__USE_TIME_BITS64`, which is set on both 32- and 64-bit platforms where `time_t` is 64 bits. The uclibc version of this config is `UCLIBC_USE_TIME64` which is only set on 32-bit platforms. Split this up by introducing `uclibc32_time64` to closer match `UCLIBC_USE_TIME64`. As an effect, setting `libc_unstable_uclibc_time64` no longer crashes builds for 64-bit uclibc targets. The setup also closer matches what is done for GNU targets. Note that `linux_time_bits64` is not actually the "64-bit time_t on any platform" yet that the kernel's version is, so it still isn't set on 64-bit platforms after this change. * `UCLIBC_USE_TIME64` definition: https://github.com/wbx-github/uclibc-ng/blob/3f2ef085d8455a13fcdc4d4d473c0385dd65d55e/extra/Configs/Config.in#L1036-L1055 * Implication of `__USE_TIME_BITS64`: https://github.com/wbx-github/uclibc-ng/blob/3f2ef085d8455a13fcdc4d4d473c0385dd65d55e/include/features.h#L458-L460 * Entrypoint for 64-bit `time_t`: https://github.com/wbx-github/uclibc-ng/blob/3f2ef085d8455a13fcdc4d4d473c0385dd65d55e/libc/sysdeps/linux/common/bits/typesizes.h#L50-L54 * Arm `struct shimd_ds`: https://github.com/wbx-github/uclibc-ng/blob/3f2ef085d8455a13fcdc4d4d473c0385dd65d55e/libc/sysdeps/linux/arm/bits/shm.h#L48-L69 (backport <rust-lang#5540>) (cherry picked from commit 3de6a1a)
Make the skip more accurate to cover ppc32 as well. Link: torvalds/linux@24e41bf (backport <rust-lang#5546>) (cherry picked from commit 2cf22d5)
Fix incorrect radix of 4 Android/RISCV constants; see: https://android.googlesource.com/platform/bionic/+/731631f300090436d7f5df80d50b6275c8c60a93/libc/kernel/uapi/asm-generic/fcntl.h#40 (backport <rust-lang#5554>) (cherry picked from commit ca9b70f)
POSIX requires HOST_NAME_MAX in <limits.h> for use with gethostname, and it was missing everywhere except Fuchsia. Added it per family, glibc and uclibc at 64 and the musl-derived and BSD-ish libcs at 255, skipping FreeBSD, NetBSD, DragonFly, Apple, Solaris/illumos and Hurd, which deliberately leave it undefined for sysconf instead. glibc 64: https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/unix/sysv/linux/bits/local_lim.h#L93 uclibc-ng 64: https://github.com/kraj/uclibc-ng/blob/f6f9f40cb17ae95610c4fe36f6ee77cfbcf05df1/libc/sysdeps/linux/common/bits/local_lim.h#L93 musl 255: https://git.musl-libc.org/cgit/musl/tree/include/limits.h?id=5e9972eaef08ccf55dabe254ac829a30329793d3#n56 android bionic 255: https://github.com/aosp-mirror/platform_bionic/blob/731631f300090436d7f5df80d50b6275c8c60a93/libc/include/bits/posix_limits.h#L135 openbsd 255: https://github.com/openbsd/src/blob/78e3ccc2aa1724882faaab7fa2366e535f039976/sys/sys/syslimits.h#L76 haiku 255: https://github.com/haiku/haiku/blob/89141b6857474342330f6205850b59435165187b/headers/posix/limits.h#L35 redox 255: https://github.com/redox-os/relibc/blob/381772ec81fced6d055f0f0ba6fa92c7f3256fbb/src/header/limits/mod.rs#L145 emscripten 255: https://github.com/emscripten-core/emscripten/blob/06e8b0d84d8b409b1b5ee59832948877bda6137e/system/lib/libc/musl/include/limits.h#L63 wasi 255: https://github.com/WebAssembly/wasi-libc/blob/06513b9ae0c1b14ca3010924939c007ed27628a1/libc-top-half/musl/include/limits.h#L56 cygwin 255: https://github.com/cygwin/cygwin/blob/00208dc31e790b8c130f32c4a0528c781fc07328/winsup/cygwin/include/cygwin/limits.h#L22 (backport <rust-lang#5531>) (cherry picked from commit 904efa2)
`renameat2` first appeared in FreeBSD 15.1 (freebsd/freebsd-src@28599a1e5f1b), so it is skipped in libc-test while CI runs 14.4 and 15.0. Source: https://github.com/freebsd/freebsd-src/blob/b5f0e7f36afc20bf17e9e955454b445d686cda06/include/stdio.h#L409 (backport <rust-lang#5563>) (cherry picked from commit f9bac8d)
NetBSD's sleep(1) only accepts a number of seconds and rejects `3s` with "usage: sleep seconds". The script runs with `set -e`, so the first failed install exits the script instead of being retried, and the retry loop has never worked on NetBSD. `sleep 3` is the POSIX form, so it works everywhere this script runs. (backport <rust-lang#5559>) (cherry picked from commit a73f854)
[1] has been fixed. This reverts commit 297152a. [1]: rust-lang/rust#160439 (backport <rust-lang#5568>) (cherry picked from commit a7522fa)
tgross35
force-pushed
the
backport-amandine
branch
from
October 1, 2026 07:12
11f64f2 to
8f8a8b8
Compare
Collaborator
|
This should match the `freebsd-version` command anyway, but is more consistent with what we do on other platforms. (backport <rust-lang#5566>) (cherry picked from commit 33021a4)
(backport <rust-lang#5569>) (cherry picked from commit 223361b)
(backport <rust-lang#5569>) (cherry picked from commit 513b995)
I believe this also corrects the value of `SO_TIMESTAMP*` and
`SO_{SND,RCV}TIMEO` on sparc32 with 64-bit `time_t`.
Link: https://github.com/torvalds/linux/blob/93f51579e7df248780214094418f205253383cc5/include/uapi/asm-generic/socket.h#L161
Link: https://github.com/torvalds/linux/blob/93f51579e7df248780214094418f205253383cc5/arch/mips/include/uapi/asm/socket.h
Link: https://github.com/torvalds/linux/blob/93f51579e7df248780214094418f205253383cc5/arch/powerpc/include/uapi/asm/socket.h
Link: https://github.com/torvalds/linux/blob/93f51579e7df248780214094418f205253383cc5/arch/sparc/include/uapi/asm/socket.h
(backport <rust-lang#5551>)
(cherry picked from commit 78be2c1)
Bind the flags for FreeBSD's `renameat2`. `AT_RENAME_NOREPLACE` and `RENAME_NOREPLACE` first ship in FreeBSD 15.1; `AT_RENAME_EXCHANGE` and `RENAME_EXCHANGE` were merged to stable/15 after releng/15.1 branched, so they first ship in 15.2. libc-test skips each pair below that version. The `AT_RENAME_*` flags are `c_int` like the other FreeBSD `AT_*` flags; the `RENAME_*` aliases are `c_uint`, matching the Linux and Redox bindings and the `unsigned int` flags argument of `renameat2`. Link: https://github.com/freebsd/freebsd-src/blob/96841ea08dcfa84b954a32dc5ae1a26c28966cf4/sys/sys/fcntl.h#L255-L256 Link: freebsd/freebsd-src@e0fe823 (backport <rust-lang#5560>) (cherry picked from commit c274424)
tgross35
force-pushed
the
backport-amandine
branch
4 times, most recently
from
October 1, 2026 07:43
209c86f to
5d98bb9
Compare
tgross35
enabled auto-merge
October 1, 2026 07:55
Give these structs the impls for `Default`. (backport <rust-lang#5576>) (cherry picked from commit e66976a)
Add commas to look more like struct syntax and remove `{ }` around
literals.
(backport <rust-lang#5577>)
(cherry picked from commit 8c1d1ec)
Add a more automatic union `Default` implementation and make use of it. (backport <rust-lang#5577>) (cherry picked from commit 1b75eaa)
Passing a file descriptor that is negative or >= FD_SETSIZE to FD_SET,
FD_CLR or FD_ISSET is undefined behavior per POSIX, and the previous
"index out of bounds" panic gave no hint of the required range. Panic
with a message that states the valid 0..FD_SETSIZE range instead.
Applies the fix across all platforms: linux_like, bsd, solarish, redox,
nto, newlib, fuchsia, haiku, cygwin, hurd, aix (bitmask via get/get_mut
+ let-else) and wasi (explicit range check). FD_ZERO is unchanged (takes
no fd). WASI has no FD_CLR.
Also adds panic! and Option::{self, None, Some} to the prelude so the
new code resolves under no_core (rustc-dep-of-std) builds.
Part of rust-lang#1401
(backport <rust-lang#5528>)
(cherry picked from commit 5b6e5a6)
[ needed to add an extra cast on WASI for the 0.2 branch - Trevor ]
`__USE_TIME_BITS64` is set on both 32-bit and 64-bit platforms if `time_t` is 64 bits. Update the usage of `linux_time_bits64` to match. (backport <rust-lang#5545>) (cherry picked from commit b6de484)
* In the CI tests, treat FreeBSD 16 identically to 15. We don't currently need or have separate definitions in the source code for FreeBSD 15 vs 16. So treat them identically during CI. * Remove some more mask constants from FreeBSD. These are bitmasks that are intended to be used within the kernel. New features may widen them, so their values aren't stable. They probably don't have any legitimate uses in userland. And their values have changed in FreeBSD 16. * A few constants got removed in 15.1 and 16.0 . * The in_conninfo struct's internal substructs got renamed in 16.0. * ifi2creq's padding fields got partially used up in 16.0, in the process relaxing its alignment requirement. * max_align_t's size increased in 16.0. But that struct should never be instantiated, so its size doesn't matter. (backport <rust-lang#5575>) (cherry picked from commit d1df215)
tgross35
force-pushed
the
backport-amandine
branch
from
October 1, 2026 07:59
5d98bb9 to
a11b896
Compare
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.
Backport the following:
cfgfor general 64-bittime_tfunctionality #5411__riscv_mc_q_ext_state.__reserved#5533linux_time_bits64with a newuclibc32_time64cfg #5540linux_time_bits64match the upstream definition #5545socket.hbits fromarchtosrc/new#5551sleepinbsd-prepare.sh#5559AT_RENAME_*andRENAME_*constants #5560renameat2#5563s!tos2!#5576#[unsafe(union_default_via_zeroed)]ins_no_extra_traits2!#5577