-
Notifications
You must be signed in to change notification settings - Fork 1.2k
newlib: Fix ambiguous glob exports and other warnings for Vita and 3DS #4875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b544c69 to
697e365
Compare
tgross35
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
|
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 |
|
Oh awesome, that makes things much easier for us. |
|
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)
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