Skip to content

Add QNX (target_os = "qnx") support to use_file backend - #878

Closed
csinnott-work wants to merge 1 commit into
rust-random:masterfrom
csinnott-work:add-qnx-support
Closed

csinnott-work wants to merge 1 commit into
rust-random:masterfrom
csinnott-work:add-qnx-support

Conversation

@csinnott-work

Copy link
Copy Markdown

Summary

QNX systems can be targeted with a custom Rust triple x86_64-pc-qnx where target_os is "qnx". This is distinct from the existing "nto" target os used by the standard x86_64-pc-nto-qnx8.0.0 triple, but refers to the same OS family.

Without this change, compiling any crate that depends on getrandom for the qnx target fails with:

error[E0425]: cannot find function `errno_location` in this scope

because neither the use_file backend nor the get_errno utility module recognize target_os = "qnx".

Changes

  • src/backends.rs: add target_os = "qnx" alongside "nto" in the use_file backend cfg block
  • src/utils/get_errno.rs: add target_os = "qnx" to the __get_errno_ptr branch (same function used by QNX/NTO)
  • Cargo.toml: add target_os = "qnx" to the use_file libc dependency cfg condition

All three changes mirror the existing "nto" entries, as both target os values refer to QNX and use the same system APIs.

Testing

Built and validated jiter 0.19.0 and pydantic-core 2.50.4 (both pyo3-based Rust extensions) for x86_64-pc-qnx using QNX SDP 8.0. The resulting .so files run correctly on QNX 8.0.0.

QNX systems support a custom target triple `x86_64-pc-qnx` where
target_os is "qnx" (distinct from the existing "nto" used by the
standard `x86_64-pc-nto-qnx8.0.0` triple).

Both "nto" and "qnx" refer to QNX operating systems and use the same
APIs: /dev/urandom for randomness and libc::__get_errno_ptr for errno.

Changes:
- backends.rs: add target_os = "qnx" to the use_file backend cfg block
- utils/get_errno.rs: add target_os = "qnx" to the __get_errno_ptr branch
- Cargo.toml: add target_os = "qnx" to the use_file libc dependency cfg
@newpavlov

Copy link
Copy Markdown
Member

See #325.

@newpavlov newpavlov closed this Nov 11, 2026
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.

3 participants