[0.2] Backports#5294
Merged
Merged
Conversation
`pread` and `pwrite` don't technically need to be `unsafe`, but it is consistent and more convenient for avoiding the `unused_unsafe` warning across targets. (backport <rust-lang#3727>) (cherry picked from commit 69178f7)
(backport <rust-lang#4936>) (cherry picked from commit f6215b8)
The internal config `linux_time_bits64` already gets set via the musl or glibc config, so it isn't useful to be able to set it on its own. Delete the env option since it isn't used anyway. (backport <rust-lang#5197>) (cherry picked from commit 88a5fa3)
(backport <rust-lang#5198>) (cherry picked from commit b03b7c9)
Prepare for needing to set different `RUSTFLAGS` per-invocation. (backport <rust-lang#5202>) (cherry picked from commit 00183a7)
Environment variables affect builds for both the host and target, while cfg can be more accurately scoped with `RUSTFLAGS`. (backport <rust-lang#5201>) (cherry picked from commit e3c4971)
Since the very first import dafaca9 ("Initial import of liblibc"), `libc` has used uninhabited enums to represent C's incomplete/opaque types. While this is, as far as I know, techincally okay when working behind raw pointers, it means that using reference types like `&FILE` can lead to easy UB. Resolve this by changing the representation to a `!Sync + !Send + !Unpin` ZST, as recommended by the nomicon [1]. The loss of auto traits technically makes this user-visible, but it is unlikely that anybody who is doing sound things was relying on these. I also used this as an opportunity to add a forward-compatibility note about intended use that should allow us to switch to real extern types once those are available. [1]: https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs (backport <rust-lang#5021>) (cherry picked from commit 1cf49df)
(backport <rust-lang#5021>) (cherry picked from commit fbaea87)
The new extern type representation raises the lint prior to 1.72 because ZSTs behind pointers were not allowed. (backport <rust-lang#5021>) (cherry picked from commit 96a27a4)
Since [1], s390x has been an exception in that it runs in system mode rather than user mode. The reason cited at that PR is that the s390x user-mode qemu could not run rust-built binaries, which has long since no longer been true (the PR is from 2017). There may be some arguments in favor of running in system mode, such as having better control over kernel version than what GHA+Docker gives us. However, the time cost is high and the benefit isn't huge, and it certainly doesn't make sense to run only a single target in system mode. Thus, switch to user mode to match other targets. Closes: rust-lang#829 [1]: rust-lang#820 (backport <rust-lang#5210>) (cherry picked from commit 5dba84e)
This platform used to be pretty slow when it was run with qemu-system. Since it now uses qemu-user, move it back with everything else. (backport <rust-lang#5210>) (cherry picked from commit 6385091)
For a while there has been an informal policy about what is and isn't allowed regarding breaking changes, but it hasn't been written down anywhere. This is an attempt to start to give our users some more concrete expectations, documented in the "Stability Expectations" section. I expect this will be updated as we think of more cases. I additionally added a "Usage Recommendations" section that is meant to give actionable suggestions about how to avoid breakage and other problems. Closes: rust-lang#5018 (backport <rust-lang#5179>) (cherry picked from commit 9595912)
This symbol has changed recently. It needs usage advice. This patch links to that. (backport <rust-lang#5119>) (cherry picked from commit 8ece5e2)
The current environment variable setup makes it easy to set a configuration for both the host (build scripts) and target, even when that is not the intent. Change to a rustc cfg, which is easier to set for only the target. This was briefly discussed on Zulip around [1]. [1]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Questions.20and.20polls.20about.20.60libc.60.201.2E0/near/511723332 (backport <rust-lang#4977>) (cherry picked from commit f08bfce)
These symbols are troublesome. They can change upstream. They don't work well with SemVer. Usage advice is needed. This patch links to it. (backport <rust-lang#5120>) (cherry picked from commit 7bb9988)
These caused SemVer issues. They can change in upstream releases. This patch aleviates that. It links to usage advice. (backport <rust-lang#5121>) (cherry picked from commit 7bdf901)
Deprecate uses of kernel symbols. Rust has support only for RTP programs. Removep polyfill routines. They were stubs. They returned error values. They don't exist in VxWorks. (backport <rust-lang#5129>) (cherry picked from commit 69c52f2)
Fixes broken rustdoc links. Makes usage advice less redundant. (backport <rust-lang#5219>) (cherry picked from commit 51bb630)
(backport <rust-lang#5217>) (cherry picked from commit a8e2958)
Most of these just need a conversion function to assert that wrapping values are okay to assign to signed int types. There are a few corrections: * Android `PR_SET_PTRACER_ANY`: https://cs.android.com/android/platform/superproject/+/android-latest-release:bionic/libc/kernel/uapi/linux/prctl.h;l=101;drc=19d5053f12cafecac5174e4c7af4c9fdfd7bcae0 * Linux `PR_SET_PTRACER_ANY`: https://github.com/torvalds/linux/blob/ab9de95c9cf952332ab79453b4b5d1bfca8e514f/include/uapi/linux/prctl.h#L156 * Haiku `B_INFINITE_TIMEOUT` is a `long long`, this is a type change: https://github.com/haiku/haiku/blob/2b75ca9e1c15526b9ff7613363bb792a28a7f7ac/headers/os/kernel/OS.h#L24 [ add `u32_cast_int` to `VM_FLAGS_*` and `EPOLLET`, and `allow(overflowing_literals) to `CLONE_CLEAR_SIGHAND` and `CLONE_INTO_CGROUP`, both of which are only relevant on this branch - Trevor ] (backport <rust-lang#5218>) (cherry picked from commit 2aa6195)
* Don't completely ignore `overflowing_literals`. This is the main thing since this lint catches things like `u64`-sized constants being assigned to a `c_long`, which is too small on 32-bit platforms. * `safe_packed_borrows` is now a hard error, we don't need to explicitly set the level. * Drop `renamed_and_removed_lints` and `unknown_lints` since we are now more selective about tested versions. Closes: rust-lang#4141 (backport <rust-lang#5218>) (cherry picked from commit 626c7dc)
(backport <rust-lang#5218>) (cherry picked from commit 92d21d3)
(backport <rust-lang#5218>) (cherry picked from commit 96e73ff)
(backport <rust-lang#5220>) (cherry picked from commit 0d9bc6e)
Add documentation to certain constants. They are unstable upstream. They need usage advice. This patch links to it. (backport <rust-lang#5122>) (cherry picked from commit 1b06eb5)
Some symbols are not stable. New upstream releases may change them. This works out badly with SemVer. Advising users is necessary. (backport <rust-lang#5123>) (cherry picked from commit 320e0ee)
Add PORT_ALERT_* constants and the port_alert declaration shared by Solaris and illumos. (backport <rust-lang#5203>) (cherry picked from commit 465e736)
(backport <rust-lang#5049>) (cherry picked from commit ae27070)
(backport <rust-lang#5223>) (cherry picked from commit 076d48f)
Link to the correct routines in Windows x86 GNU. These were not linked before. They expected a 64-bit `time_t`. This is not the bit width exposed in `libc` for `time_t` in that target triple. (backport <rust-lang#5059>) (cherry picked from commit 5bbfc84)
Collaborator
|
tgross35
enabled auto-merge
July 20, 2026 21:42
Merged
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:
unsafe#3727RUST_LIBC_UNSTABLEenv withlibc_unstable*cfg #4977cfgfor 64-bittime_t#5062aarch64-unknown-linux-pauthtesttarget #5065RAND_MAX#5119*LASTconstants #5120*COUNTconstants #5121*MAXconstants #5122*NUMconstants #5123cfgto definition ofoff64_tandoff_t#5129RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64#5197Stringwithstrin glibc config to avoid clones #5198RUSTFLAGSon its own rather than via env #5202tls.hAPI tosrc/new#5216futex.hAPI tosrc/new#5217semandtimezonestructs as extern types #5220extern_ty!#5223types.hAPI tosrc/new#5233ifaddrmsgandrtattr#5234IN6_IFF_*andSIOCGIFAFLAG_IN6on apple and freebsd #5239cfgwith checking for targetcfg#5248SO_RERROR#5260_IO*functions, refactorttycomtosrc/new#5264