Skip to content

Conversation

@pheki
Copy link
Contributor

@pheki pheki commented Dec 4, 2025

Description

This is actually a followup of #4811. It turns out that it accidentally introduced an ambiguous glob export for _SC_PAGESIZE and _SC_GETPW_R_SIZE_MAX. After updating newlib, rustc is fails to compile for these targets as it can't resolve _SC_PAGESIZE here: https://github.com/rust-lang/rust/blob/5325015e29874334003d33d77b295d57f593f06a/library/std/src/sys/pal/unix/os.rs#L530-L532

While checking, I realized there were also other warnings, for many newlib structures that ended up being unused, which I fixed:

hostent definitions:

  1. src/unix/mod.rs: The only actually resolved by rustc, and the most similar to newlib since at least 2017

  2. 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.

  3. 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 updated 1. so this definition will now be used.

pollfd

The 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 for horizon except for dirent.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (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=core for:

  • armv7-sony-vita-newlibeabihf: No warnings
  • armv6k-nintendo-3ds: No warnings
  • armv7-rtems-eabihf: Only an unused import warning on src/new/mod.rs: pub(crate) use rtems::*;

@rustbot label +stable-nominated

@rustbot rustbot added O-newlib O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Dec 4, 2025
@pheki pheki force-pushed the newlib-ambiguous-exports branch from b544c69 to 697e365 Compare December 4, 2025 04:57
@pheki
Copy link
Contributor Author

pheki commented Dec 4, 2025

Pinging @Meziu as you as you're the 3DS maintainer who worked on #3863, in case you're available to help validating these changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-newlib O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants