Skip to content

[0.2] Backports, 0.2.189 release#5305

Merged
tgross35 merged 14 commits into
rust-lang:libc-0.2from
tgross35:backport-red-bliss
Jul 21, 2026
Merged

[0.2] Backports, 0.2.189 release#5305
tgross35 merged 14 commits into
rust-lang:libc-0.2from
tgross35:backport-red-bliss

Conversation

tgross35 and others added 11 commits July 21, 2026 20:42
Usage:

    ./etc/libc-util.py backport --branch backport-carrot
    ./etc/libc-util.py backport-pr-description --branch backport-carrot

There is a script on the libc-0.2 branch for backporting as well, but
this one uses a `git rebase` todo to be a bit more robust against
conflicts. The libc-0.2 script also doesn't pick from the correct SHAs
since the GitHub API doesn't give a list of commits as merged (instead,
only commits as they are in the PR).

(backport <rust-lang#5292>)
(cherry picked from commit 8195eb4)
Doing this doesn't cause any warnings to appear

(backport <rust-lang#5277>)
(cherry picked from commit e5e3355)
illumos usr/src/uts/common/sys/time_impl.h defines
CLOCK_THREAD_CPUTIME_ID=2 (alias CLOCK_PROF) and
CLOCK_PROCESS_CPUTIME_ID=5, but libc never bound them for solarish,
so any crate that references these clock ids (e.g. the cpu-time
crate) fails to build on illumos/solaris.

Also drops the stale comment claiming clock_gettime(3c) "doesn't
seem to accept anything other than CLOCK_REALTIME" -- that was true
prior to illumos-gate commit dea9f5e6a49 (2021-10-16, "14126
clock_gettime() could work with thread/proc clocks"), which taught
clock_gettime(3c) to honor the thread/process CPU-time clocks; both
Oracle Solaris 11.4 and current illumos document and accept them.

Verified at runtime on OpenIndiana 2026.04 via clock_gettime(3c)
with both clock ids (both return 0).

(backport <rust-lang#5274>)
(cherry picked from commit efe08d7)
The new ci/cuttlefish-setup.sh is heavily inspired by Mesa CI's
cuttlefish-runner.sh, credited in the script.

For more details, see the following issue, of which this is part of:
rust-lang#5262

In a nutshell, the libc x86_64 job never booted Android: it extracted
bionic from a 2016-era (API 24) image and ran the test binaries directly
on the Ubuntu host kernel. This makes the CI test boot the official
stock Android 17 image via Cuttlefish.

The virtual device boots inside the test container, self-contained:
Cuttlefish host packages are installed in the x86_64-linux-android
image and the container entrypoint creates the tap networking via
the deb's sysv script as root, then drops to an unprivileged user.

The container needs only the virtualization device nodes plus
CAP_NET_ADMIN, the same flags upstream uses for its own containerized
Cuttlefish CI, so nothing on the CI host is mutated and a local run
reduces to the usual ./ci/run-docker.sh with no host setup beyond KVM.

The container still cross-compiles with the NDK and drives the device
over adb, reusing the runtest-android.rs wrapper unchanged.

Device logs are uploaded as CI artifacts (again similar to Mesa).

The other Android targets stay on the legacy SDK emulator for now.

Assisted-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>

(backport <rust-lang#5269>)
(cherry picked from commit e194438)
(backport <rust-lang#5245>)
(cherry picked from commit 28a8833)
fix signedness of wchar_t under arm and aarch64. this was not correctly
handled as this type will likely be defined in terms of predefined
compiler macros [^1]. these macros expand to different types on our
currently supported nuttx targets. they are only signed integers under
riscv [^2].

[^1]: https://github.com/search?q=repo%3Aapache%2Fnuttx+%2F%5Cb_wchar_t%5Cb%2F&type=code
[^2]: https://c.godbolt.org/z/czMY79vsh

(backport <rust-lang#5245>)
(cherry picked from commit 35095ff)
These were unintentionally removed as part of the "Fixes" commit.

Fixes: 5bbfc84 ("windows(gnu): link to correct 32-bit time routines")
Closes: rust-lang#5299

(backport <rust-lang#5300>)
(cherry picked from commit 1268c28)
Starting with version 7.0, the Linux kernel gained support
for clone3() on SPARC. Thus, it can be enabled in libc now.

(backport <rust-lang#4980>)
(cherry picked from commit 177e0cd)
The current behavior of automatically adding `unsafe` means the
functions read differently from how they actually get defined. This gets
confusing, especially in large blocks or diffs where the `f!` may not be
obvious.

Make the `unsafe` keyword required, similar to most Rust function
definitions.

(backport <rust-lang#5302>)
(cherry picked from commit bbd9253)
bbd9253 ("macros: Require unsafe in `f!` invocations") made
`unsafe` required in `f!`. Do the same for `safe_f!`, requiring a `safe`
keyword.

Similar to the `f!` changes, the goal is to make it more obvious whether
a function is safe or not just by reading the signature. Technically
`safe` isn't really required for that because by default functions are
safe. However the `unsafe` requirement in `f!` is recent so the extra
keyword helps avoid confusion as to whether `pub fn` is safe (default
Rust) or unsafe (would previously be the case with `f!`).

This also allows us to merge `f!` and `safe_f!` without risk of
accidentally making any in-flight patches safe (if they used `f!` before
`unsafe` was required).

(backport <rust-lang#5303>)
(cherry picked from commit c8b6cc2)
@rustbot

rustbot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in a solarish module

cc @jclulow, @pfmooney

Some changes occurred in an OpenBSD module

cc @semarie

Some changes occurred in an Android module

cc @maurer

Some changes occurred in a NetBSD-like module

cc @semarie

@rustbot

rustbot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • Pull requests are usually filed against the main branch for this repo, but this one is against libc-0.2. Please double check that you specified the right target!

@tgross35
tgross35 enabled auto-merge July 21, 2026 20:46
tgross35 added 2 commits July 21, 2026 20:51
These showed after a recent commit removing the `allow`.
Build fails on `riscv32gc-unknown-linux-musl` because the fields
`__pad1` and `__pad2` are duplicated. This likely came up during the
apply then revert of the `timespec` change.

Rename `__pad1` to `__st_rdev_padding` to match other musl `struct stat`
instances. None of the others seem to have padding for `st_blksize` so
this name is new but follows the same pattern.
@tgross35 tgross35 changed the title [0.2] Backports [0.2] Backports, 0.2.189 release Jul 21, 2026
@tgross35
tgross35 added this pull request to the merge queue Jul 21, 2026
Merged via the queue into rust-lang:libc-0.2 with commit ef0906e Jul 21, 2026
56 checks passed
@tgross35
tgross35 deleted the backport-red-bliss branch July 21, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants