Skip to content

std: add platform support for hexagon-unknown-qurt#152084

Open
androm3da wants to merge 2 commits intorust-lang:mainfrom
androm3da:bcain/qurt-libstd-support
Open

std: add platform support for hexagon-unknown-qurt#152084
androm3da wants to merge 2 commits intorust-lang:mainfrom
androm3da:bcain/qurt-libstd-support

Conversation

@androm3da
Copy link
Copy Markdown
Contributor

@androm3da androm3da commented Feb 4, 2026

View all comments

QuRT provides POSIX-like APIs for basic operations, so this implementation reuses the unix platform abstraction layer with QuRT-specific customizations.

Platform modules:

  • New os::qurt module with platform-specific extensions to ffi, fs, io, raw
  • QuRT-specific file handling for ino, dev, mode, nlink, etc.

Unsupported: Networking, fork/exec, pipe, chown/fchown/lchown/chroot/mkfifo

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 4, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 4, 2026

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from 791d71f to 3201966 Compare February 4, 2026 15:11
@androm3da
Copy link
Copy Markdown
Contributor Author

This PR depends on a newer version of the libc crate - maybe I'll let this PR hang here for a bit and check back in when it gets released and promoted?

@rust-log-analyzer

This comment has been minimized.

@joboet
Copy link
Copy Markdown
Member

joboet commented Feb 7, 2026

This PR depends on a newer version of the libc crate - maybe I'll let this PR hang here for a bit and check back in when it gets released and promoted?

You need libc at 0.2.179, right? You can update libc here – but please keep it in a separate commit.

@joboet
Copy link
Copy Markdown
Member

joboet commented Feb 7, 2026

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 7, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 7, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@androm3da
Copy link
Copy Markdown
Contributor Author

This PR depends on a newer version of the libc crate - maybe I'll let this PR hang here for a bit and check back in when it gets released and promoted?

You need libc at 0.2.179, right? You can update libc here – but please keep it in a separate commit.

The commit I need - rust-lang/libc@9934c04 is not yet tagged/released. Or rather there is a ctest-* tag but I suspect that doesn't apply/not intended use for that tag. Should I try to execute a tag/release of libc, or just wait for that to happen naturally?

@rust-bors

This comment has been minimized.

@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from 3201966 to 5adcafb Compare February 10, 2026 19:47
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@androm3da
Copy link
Copy Markdown
Contributor Author

androm3da commented Feb 17, 2026

This PR depends on a newer version of the libc crate - maybe I'll let this PR hang here for a bit and check back in when it gets released and promoted?

You need libc at 0.2.179, right? You can update libc here – but please keep it in a separate commit.

The commit I need - rust-lang/libc@9934c04 is not yet tagged/released. Or rather there is a ctest-* tag but I suspect that doesn't apply/not intended use for that tag. Should I try to execute a tag/release of libc, or just wait for that to happen naturally?

Ah - I see now that it appears in 0.2.181 and there's already a PR open for that (#150752). I'll rebase when that lands.

@rust-bors

This comment has been minimized.

@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from 5adcafb to caab9c9 Compare March 31, 2026 23:16
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from caab9c9 to 3749f50 Compare April 1, 2026 03:17
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@androm3da
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 2, 2026
@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from 14aa853 to de8ba26 Compare April 4, 2026 12:37
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch 2 times, most recently from 535996f to c017dd6 Compare April 5, 2026 13:42
@androm3da
Copy link
Copy Markdown
Contributor Author

cc @quic-mliebel

@androm3da
Copy link
Copy Markdown
Contributor Author

gentle ping @joboet

Comment thread library/test/src/lib.rs Outdated
@quic-mliebel
Copy link
Copy Markdown

LGTM once libc::stat and raw::stat match

@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from 53a33f8 to c526632 Compare April 13, 2026 23:06
@rustbot

This comment has been minimized.

@androm3da
Copy link
Copy Markdown
Contributor Author

LGTM once libc::stat and raw::stat match

Fixed

@quic-mliebel
Copy link
Copy Markdown

Looks like blkcnt_t and blksize_t are needed:

python3 x.py check library --target hexagon-unknown-qurt

...

error[E0432]: unresolved import `super::platform::raw::blkcnt_t`
  --> library/std/src/os/unix/raw.rs:30:32
   |
30 | pub use super::platform::raw::{blkcnt_t, time_t};
   |                                ^^^^^^^^ no `blkcnt_t` in `os::qurt::raw`
   |
   = help: consider importing this type alias instead:
           libc::blkcnt_t

error[E0432]: unresolved import `super::platform::raw::blksize_t`
  --> library/std/src/os/unix/raw.rs:33:32
   |
33 | pub use super::platform::raw::{blksize_t, dev_t, ino_t, mode_t, nlink_t, off_t};
   |                                ^^^^^^^^^ no `blksize_t` in `os::qurt::raw`
   |
   = help: consider importing this type alias instead:
           libc::blksize_t

@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from c526632 to 1325ffa Compare April 16, 2026 19:58
@androm3da
Copy link
Copy Markdown
Contributor Author

Looks like blkcnt_t and blksize_t are needed:

python3 x.py check library --target hexagon-unknown-qurt

...

error[E0432]: unresolved import `super::platform::raw::blkcnt_t`
  --> library/std/src/os/unix/raw.rs:30:32
   |
30 | pub use super::platform::raw::{blkcnt_t, time_t};
   |                                ^^^^^^^^ no `blkcnt_t` in `os::qurt::raw`
   |
   = help: consider importing this type alias instead:
           libc::blkcnt_t

error[E0432]: unresolved import `super::platform::raw::blksize_t`
  --> library/std/src/os/unix/raw.rs:33:32
   |
33 | pub use super::platform::raw::{blksize_t, dev_t, ino_t, mode_t, nlink_t, off_t};
   |                                ^^^^^^^^^ no `blksize_t` in `os::qurt::raw`
   |
   = help: consider importing this type alias instead:
           libc::blksize_t

Fixed, thanks

@androm3da
Copy link
Copy Markdown
Contributor Author

ping @joboet

@joboet
Copy link
Copy Markdown
Member

joboet commented May 5, 2026

Sorry for the delay, I was taking a bit of a break from reviewing.

Could you provide a bit more context on QuRT? It looks like quite a lot of UNIX stuff is stubbed out here. How much UNIX-compatibility does QuRT actually provide? I'm asking because we have some similar UNIX-adjacent targets (e.g. Hermit, TEEOS) that don't list UNIX as their target family and instead just reuse the UNIX code in std where applicable.

@rustbot label +I-libs-nominated
I think this question has come up before, but how much UNIX-compatibility do you want to require for the UNIX target family?

@rustbot rustbot added the I-libs-nominated Nominated for discussion during a libs team meeting. label May 5, 2026
@androm3da
Copy link
Copy Markdown
Contributor Author

Sorry for the delay, I was taking a bit of a break from reviewing.

Could you provide a bit more context on QuRT? It looks like quite a lot of UNIX stuff is stubbed out here. How much UNIX-compatibility does QuRT actually provide? I'm asking because we have some similar UNIX-adjacent targets (e.g. Hermit, TEEOS) that don't list UNIX as their target family and instead just reuse the UNIX code in std where applicable.

QuRT is a proprietary RTOS for Hexagon, ARM, RISC-V architectures that is usually focused on embedded DSP/uC devices without a direct storage device, without an interactive terminal/shell/UART. It has memory-protected processes, some POSIX capability like pthreads/mutexes. QuRT lacks SysV IPC. QuRT provides an indirect access to a filesystem via calls to some-other-SoC-node-with-a-disk.

But yeah - I'm totally fine w/redoing this PR to avoid touching UNIX and making it look more like hermit/teeos. Will take a look and update the PR.

androm3da added 2 commits May 5, 2026 15:49
Remove unix family from hexagon-unknown-qurt target spec and instead
explicitly opt into unix implementations where applicable, following the
pattern used by similar unix-adjacent targets.

The target uses the unix PAL and explicitly selects unix implementations
for the supported features.

Modules that remain unsupported for qurt: process spawning, networking
and pipes.
Update documentation with details about how to leverage qurt, now that
there's some level of libstd support
@androm3da androm3da force-pushed the bcain/qurt-libstd-support branch from 1325ffa to 1bd87eb Compare May 6, 2026 01:43
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 6, 2026

Some changes occurred in src/doc/rustc/src/platform-support

cc @Noratrieb

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 6, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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

Labels

I-libs-nominated Nominated for discussion during a libs team meeting. O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

5 participants