newlib: Fix ambiguous glob exports and other warnings for Vita and 3DS#4875
Merged
tgross35 merged 1 commit intorust-lang:mainfrom Dec 17, 2025
Merged
Conversation
b544c69 to
697e365
Compare
Contributor
Author
Contributor
|
I have an unrelated question if you are familiar with newlib: how does it handle 64-bit time_t? E.g. musl did a complete changeover at once, glibc has the test macros. |
Contributor
newlib defaults to 64-bit time_t unless it was configured with |
Contributor
|
Oh awesome, that makes things much easier for us. |
Contributor
Author
|
Thanks! As a note and for future reference, vita's newlib uses that option, so it has 32-bit time_t. |
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Dec 28, 2025
(backport <rust-lang#4875>) (cherry picked from commit fb18f26)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Dec 30, 2025
…pratt Mark set_times as unavailable for RTEMS target This PR just updates one of the config switches to exclude `utimesat` for the RTEMS target. This currently creates undefined reference errors when building the target. With this fix applied it also needs a fix in libc (see rust-lang/libc#4875) which will hopefully be available in release 0.2.179.
rust-timer
added a commit
to rust-lang/rust
that referenced
this pull request
Dec 30, 2025
Rollup merge of #150484 - thesummer:rtems-fix-utimesat, r=jhpratt Mark set_times as unavailable for RTEMS target This PR just updates one of the config switches to exclude `utimesat` for the RTEMS target. This currently creates undefined reference errors when building the target. With this fix applied it also needs a fix in libc (see rust-lang/libc#4875) which will hopefully be available in release 0.2.179.
tgross35
pushed a commit
to tgross35/rust-libc
that referenced
this pull request
Jan 3, 2026
(backport <rust-lang#4875>) (cherry picked from commit fb18f26)
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.
Description
This is actually a followup of #4811. It turns out that it accidentally introduced an ambiguous glob export for
_SC_PAGESIZEand_SC_GETPW_R_SIZE_MAX. After updating newlib, rustc is fails to compile for these targets as it can't resolve_SC_PAGESIZEhere: https://github.com/rust-lang/rust/blob/5325015e29874334003d33d77b295d57f593f06a/library/std/src/sys/pal/unix/os.rs#L530-L532While checking, I realized there were also other warnings, for many newlib structures that ended up being unused, which I fixed:
hostentdefinitions:src/unix/mod.rs: The only actually resolved by rustc, and the most similar to newlib since at least 2017
src/unix/newlib/mod.rs: This one has been there since the start of the newlib module, which matched the 3DS upstream definition at the time. Since then, Revise network definitions for HorizonOS #3863 arrived removing the 3DS (horizon) from that definition as the upstream header had been updated.
src/unix/newlib/horizon/mod.rs: This one is the new correct definition for horizon, which was deliberately added in Revise network definitions for HorizonOS #3863 but is not being used as it's shadowed by
1.. I updated1.so this definition will now be used.pollfdThe definition in src/unix/mod.rs is the one being used and it matches with upstream newlib and the vita.
The definition in src/unix/newlib/mod.rs was unused but it matches with the 3ds headers, so I moved it into horizon and opted it out from the above.
unix::newlib::generic::{sigset_t, stat, dirent}All unused as they were shadowed by
vita's own definitions. Same goes forhorizonexcept fordirent.Sources
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
Checked locally using
cargo +nightly check --target {target} -Z build-std=corefor:armv7-sony-vita-newlibeabihf: No warningsarmv6k-nintendo-3ds: No warningsarmv7-rtems-eabihf: Only an unused import warning onsrc/new/mod.rs:pub(crate) use rtems::*;@rustbot label +stable-nominated