Skip to content

Support upstream Rust's QNX 8.0 targets (target_os = "qnx") - #1750

Open
Mattbusel wants to merge 1 commit into
bytecodealliance:mainfrom
tensorust-ai:qnx-target-os
Open

Mattbusel wants to merge 1 commit into
bytecodealliance:mainfrom
tensorust-ai:qnx-target-os

Conversation

@Mattbusel

Copy link
Copy Markdown

rustix does not build for upstream Rust's QNX 8.0 targets. x86_64-pc-qnx and aarch64-unknown-qnx (see the nto-qnx platform page) report target_os = "qnx", and every QNX cfg in rustix tests target_os = "nto", so the libc backend compiles with no QNX arms:

error[E0425]: cannot find value `EDOTDOT` in module `c`
   --> src/backend/libc/io/errno.rs:253:38

With all-apis there are about 150 errors. tempfile and everything else that reaches rustix stop there on these targets.

Change

  • build.rs sets an nto cfg for both target_os = "nto" and target_os = "qnx". That is the grouping libc uses (both are in its nto module), and the same pattern as apple, bsd and solarish. The QNX cfgs use it (a mechanical target_os = "nto" to nto replacement, plus rustfmt), and cfg(nto) is added to the check-cfg list.
  • AddressFamily::NS: AF_NS exists only in io-pkt, the QNX 7 network stack. io-sock (QNX 7.1 iosock and QNX 8) has no AF_NS, so it is now limited to target_env = "nto70" / "nto71". Before this, all-apis also failed on x86_64-pc-nto-qnx710_iosock at src/net/types.rs:700.

Checked with cargo +nightly build -Zbuild-std=std,panic_abort, default features and --features all-apis: x86_64-pc-qnx, aarch64-unknown-qnx, x86_64-pc-nto-qnx710, x86_64-pc-nto-qnx710_iosock. On main the first two fail as above and the iosock target fails at AF_NS with all-apis. cargo fmt --check is clean and stable cargo check --features all-apis passes for x86_64-unknown-linux-gnu. These are build checks; I have not run the test suite on a QNX 8 kernel.

Found with atlas claims from qnx-crate-atlas, which I maintain: it builds every top-500 crate for the targets it claims, and rustix failed the upstream QNX build.

Upstream Rust's QNX 8.0 targets, x86_64-pc-qnx and aarch64-unknown-qnx,
report target_os = "qnx". Every QNX cfg in rustix tests target_os = "nto",
so on those targets the libc backend is compiled with no QNX arms and the
build stops at src/backend/libc/io/errno.rs:253 (cannot find value
EDOTDOT in module c), followed by about 150 more errors with all-apis.

build.rs now sets an nto cfg for both target_os = "nto" and
target_os = "qnx", the same grouping libc uses (both live in its nto
module), and the QNX cfgs use it, like apple, bsd and solarish.

AF_NS exists only in io-pkt, the QNX 7 network stack. io-sock (QNX 7.1
iosock and QNX 8) has no AF_NS, so AddressFamily::NS is now limited to
the nto70 and nto71 environments; before this, all-apis also failed on
x86_64-pc-nto-qnx710_iosock.

Built with nightly -Zbuild-std, default features and all-apis:
x86_64-pc-qnx, aarch64-unknown-qnx, x86_64-pc-nto-qnx710,
x86_64-pc-nto-qnx710_iosock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant