Uh oh!
There was an error while loading. Please reload this page.
newlib: Fix ambiguous glob exports and other warnings for Vita and 3DS - #4875
Conversation
b544c69 to
697e365Comparepheki
commented
Dec 4, 2025
tgross35
commented
Dec 17, 2025
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. |
newlib defaults to 64-bit time_t unless it was configured with |
tgross35
commented
Dec 17, 2025
Oh awesome, that makes things much easier for us. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
pheki
commented
Dec 18, 2025
Thanks! As a note and for future reference, vita's newlib uses that option, so it has 32-bit time_t. |
(backport <rust-lang#4875>) (cherry picked from commit fb18f26)
…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.
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.
(backport <rust-lang#4875>) (cherry picked from commit fb18f26)
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