Support new qnx targets#5241
Conversation
|
Well this seems to fail because the copy of |
| ( | ||
| "target_os", | ||
| &[ | ||
| "switch", "aix", "ohos", "hurd", "rtems", "visionos", "nuttx", "cygwin", "qurt", | ||
| ], | ||
| ), |
There was a problem hiding this comment.
If that's a new config only in nightly, you'll need to update this
|
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. |
|
|
sigh. I clicked the "Merge changes from main" button, but the bot tells me I shouldn't have clicked the button. I'll rebase. |
|
I wish I could disable that button or make it rebase-only, unfortunately nothing we've tried can make it disappear |
Without this, using a mutex on QNX will fail with -EINVAL.
196df63 to
825590e
Compare
|
|
@tgross35 should I prepare a libc-0.2 patch for this, so we can get it into the Rust toolchain? |
|
No need, I do cherry picks before releases. Planning on something in the next few days. |
|
Fantastic. Do I need to poke rust-lang/rust to pick that release up, or does that happen automatically? |
|
There are automatic lockfile bump PRs but they kind of tend to get stuck, so you can always do your own just for |
Fixes for QNX SDP 8 This PR contains libstd fixes so libstd can be build for QNX SDP 8. It requires patches to libc-0.2 and cc-rs. The cc-rs patch [was merged]([rust-lang/cc-rs#1775](rust-lang/cc-rs#1775)) already. I have a patch for libc-1.0 [here](rust-lang/libc#5241) which will need backporting to libc-0.2 once merged. With these in place, I was able to remotely `test tests/ui library/std library/alloc library/core` for `x86_64-pc-qnx` using a remote-test-server running on QNX SDP 8.0's QEMU BSP image. The only tests that failed were the two `tests/ui/codegen/huge-stacks.rs` tests, and I did not have enough RAM to run them.
Fixes for QNX SDP 8 This PR contains libstd fixes so libstd can be build for QNX SDP 8. It requires patches to libc-0.2 and cc-rs. The cc-rs patch [was merged]([rust-lang/cc-rs#1775](rust-lang/cc-rs#1775)) already. I have a patch for libc-1.0 [here](rust-lang/libc#5241) which will need backporting to libc-0.2 once merged. With these in place, I was able to remotely `test tests/ui library/std library/alloc library/core` for `x86_64-pc-qnx` using a remote-test-server running on QNX SDP 8.0's QEMU BSP image. The only tests that failed were the two `tests/ui/codegen/huge-stacks.rs` tests, and I did not have enough RAM to run them.
Fixes for QNX SDP 8 This PR contains libstd fixes so libstd can be build for QNX SDP 8. It requires patches to libc-0.2 and cc-rs. The cc-rs patch [was merged]([rust-lang/cc-rs#1775](rust-lang/cc-rs#1775)) already. I have a patch for libc-1.0 [here](rust-lang/libc#5241) which will need backporting to libc-0.2 once merged. With these in place, I was able to remotely `test tests/ui library/std library/alloc library/core` for `x86_64-pc-qnx` using a remote-test-server running on QNX SDP 8.0's QEMU BSP image. The only tests that failed were the two `tests/ui/codegen/huge-stacks.rs` tests, and I did not have enough RAM to run them.
Rollup merge of #158697 - ferrocene:qnx-sdp-8-fixes, r=aapoalas Fixes for QNX SDP 8 This PR contains libstd fixes so libstd can be build for QNX SDP 8. It requires patches to libc-0.2 and cc-rs. The cc-rs patch [was merged]([rust-lang/cc-rs#1775](rust-lang/cc-rs#1775)) already. I have a patch for libc-1.0 [here](rust-lang/libc#5241) which will need backporting to libc-0.2 once merged. With these in place, I was able to remotely `test tests/ui library/std library/alloc library/core` for `x86_64-pc-qnx` using a remote-test-server running on QNX SDP 8.0's QEMU BSP image. The only tests that failed were the two `tests/ui/codegen/huge-stacks.rs` tests, and I did not have enough RAM to run them.
(backport <rust-lang#5241>) (cherry picked from commit fe8ef15)
Without this, using a mutex on QNX will fail with -EINVAL. (backport <rust-lang#5241>) (cherry picked from commit 238da5e)
(backport <rust-lang#5241>) (cherry picked from commit a235a11)
(backport <rust-lang#5241>) (cherry picked from commit fe8ef15)
Without this, using a mutex on QNX will fail with -EINVAL. (backport <rust-lang#5241>) (cherry picked from commit 238da5e)
(backport <rust-lang#5241>) (cherry picked from commit a235a11)
(backport <rust-lang#5241>) (cherry picked from commit fe8ef15)
Without this, using a mutex on QNX will fail with -EINVAL. (backport <rust-lang#5241>) (cherry picked from commit 238da5e)
(backport <rust-lang#5241>) (cherry picked from commit a235a11)
libc versions >= 0.2.187 introduced an io_pkt/io_sock cfg_if split in
src/unix/nto/mod.rs with no arm for target_env="nto80" (QNX SDP 8),
causing a panic!("Unsupported arch") compile error for QNX8 targets
whose rustc still reports target_os="nto" (see rust-lang/libc#5241 and
rust-lang/rust#158449 for the eventual upstream QNX8 target rename that
libc expects).
The previous "0.2.186" version spec is a caret/minimum requirement, so
crate_universe re-resolution could still silently pick a newer, broken
libc release. Pin it exactly to prevent that.
score_crates only constrained libc to a minimum version ("0.2.186"),
so a routine crate_universe re-resolution could silently pick up a
newer, broken libc release: since libc 0.2.187 (the io_pkt/io_sock
split added upstream, see rust-lang/libc#5241 tracking QNX SDP 8
support) the `target_env = "nto80"` case falls through to
`panic!("Unsupported arch")` in src/unix/nto/mod.rs, because our
current Ferrocene rustc still reports `target_os = "nto"` (not the
newer `target_os = "qnx"` introduced by rust-lang/rust#158449, which
our toolchain predates). This commit exactly pins libc to "=0.2.186",
the last known-good release for our QNX8 target
(eclipse-score/score-crates#60, not yet
released/tagged).
score_crates only constrained libc to a minimum version ("0.2.186"),
so a routine crate_universe re-resolution could silently pick up a
newer, broken libc release: since libc 0.2.187 (the io_pkt/io_sock
split added upstream, see rust-lang/libc#5241 tracking QNX SDP 8
support) the `target_env = "nto80"` case falls through to
`panic!("Unsupported arch")` in src/unix/nto/mod.rs, because our
current Ferrocene rustc still reports `target_os = "nto"` (not the
newer `target_os = "qnx"` introduced by rust-lang/rust#158449, which
our toolchain predates). This commit exactly pins libc to "=0.2.186",
the last known-good release for our QNX8 target
(eclipse-score/score-crates#60, not yet
released/tagged).
score_crates only constrained libc to a minimum version ("0.2.186"),
so a routine crate_universe re-resolution could silently pick up a
newer, broken libc release: since libc 0.2.187 (the io_pkt/io_sock
split added upstream, see rust-lang/libc#5241 tracking QNX SDP 8
support) the `target_env = "nto80"` case falls through to
`panic!("Unsupported arch")` in src/unix/nto/mod.rs, because our
current Ferrocene rustc still reports `target_os = "nto"` (not the
newer `target_os = "qnx"` introduced by rust-lang/rust#158449, which
our toolchain predates). This commit exactly pins libc to "=0.2.186",
the last known-good release for our QNX8 target
(eclipse-score/score-crates#60, not yet
released/tagged).
Description
Updates libc to support the newly renamed targets for QNX SDP 8
This PR largely involves adding
target_os = "qnx"everywhere that saidtarget_os = "nto", and replacingtarget_env = "nto800"withtarget_os = "qnx".Plus there are some pthread mutex fixes, which we took from the our header files.
Sources
For QNX SDP 8.0:
For QNX SDP 7.1:
I don't have QNX SDP 7.0 available, so the old code path was left as-is.
Checklist
libc-test/semverhave been updated (there are none)*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated