Skip to content

std: fix build on RTEMS after libc 0.2.191 - #165629

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
lazerg:fix/rtems-stat-timespec
Nov 8, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
lazerg:fix/rtems-stat-timespec

Conversation

@lazerg

@lazerg lazerg commented Nov 8, 2026 •

Copy link
Copy Markdown

libc 0.2.191 changed newlib's stat on RTEMS to use st_atim/st_mtim/st_ctim timespecs, so std stopped compiling for armv7-rtems-eabihf. This reads the timestamps from the timespec fields, which also gives RTEMS real nanosecond values instead of 0. I also added RTEMS to the ReadDir::dir fallback list: libc has no dirfd for it, and the other dirfd cfg lists in that file already skip RTEMS.

Checked with cargo check -Zbuild-std --target armv7-rtems-eabihf.

Fixes #164719

@rustbot rustbot added A-filesystem Area: `std::fs` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 8, 2026
@rustbot

rustbot commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @Mark-Simulacrum (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 38 candidates
  • Random selection from JohnTitor, LawnGnome, Mark-Simulacrum, hanna-kruppe

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3481260 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 8, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #160777 (Document and correct assignment order for yield and inline-asm)
 - #165224 (Ensure all output is printed from lldb debugger tester)
 - #165629 (std: fix build on RTEMS after libc 0.2.191)
 - #163624 (String::retain: convert only the untouched UTF-8 tail)
 - #164519 (Add Documentation for the `crate_type` attribute)
 - #165249 (Fix unused attribute duplication for lint attributes)
 - #165643 (oneshot_multi_task_recv_then_send test: wait for test thread to finish)
@rust-bors
rust-bors Bot merged commit b222250 into rust-lang:main Nov 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 8, 2026
Rollup merge of #165629 - lazerg:fix/rtems-stat-timespec, r=Mark-Simulacrum

std: fix build on RTEMS after libc 0.2.191

libc 0.2.191 changed newlib's `stat` on RTEMS to use `st_atim`/`st_mtim`/`st_ctim` timespecs, so std stopped compiling for armv7-rtems-eabihf. This reads the timestamps from the timespec fields, which also gives RTEMS real nanosecond values instead of 0. I also added RTEMS to the `ReadDir::dir` fallback list: libc has no `dirfd` for it, and the other `dirfd` cfg lists in that file already skip RTEMS.

Checked with `cargo check -Zbuild-std --target armv7-rtems-eabihf`.

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

Labels

A-filesystem Area: `std::fs` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std no longer builds for armv7-rtems-eabihf: no field st_atime on stat

3 participants