-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support QNX 7.1 with io-sock
+libstd and QNX 8.0 (no_std
only)
#133631
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
96a91e2
to
6116b6a
Compare
This comment has been minimized.
This comment has been minimized.
So, first up, excellent! The AWS QNX Neutrino 7.1.0 AMIs appears to use iosock and so I have to keep copying over However, I note that there are currently no five-part-triples in the target list, so this would be the first. Perhaps Will there be a |
This comment was marked as resolved.
This comment was marked as resolved.
Beware that version 3 and 4 have different APIs -- they may seem to work, but there might be subtle issues up to undefined behavior.
Very good idea -- I found it confusing that target_env uses an underscore while the target name does not. I will rename it!
Not planned so far, but should be quite easy to do. How big is the need for it? |
No idea. Who was asking for this target? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
I was thinking to use an obvious dummy value rather than panicking if the environment variable isn't set. But maybe the project people have a better idea. Are there another other targets that need to read environment variables? |
This comment was marked as resolved.
This comment was marked as resolved.
5051c34
to
00079dc
Compare
This comment has been minimized.
This comment has been minimized.
72b6642
to
32310c3
Compare
This comment has been minimized.
This comment has been minimized.
519c76c
to
80d6d03
Compare
io-sock
network stackio-sock
network stack and 8.0
As @pnkfelix left the compiler team, I would like to kindly ask @workingjubilee if they could have a look at this PR 😄 🎄 🎉 |
80d6d03
to
6e472e4
Compare
This comment has been minimized.
This comment has been minimized.
6e472e4
to
9ec4be2
Compare
On Windows 10, I get: C:\Users\JonathanPallant\Documents\rust>C:\Users\JonathanPallant\AppData\Roaming\uv\python\cpython-3.13.1-windows-x86_64-none\python.exe .\x.py build --target=x86_64-pc-windows-msvc,x86_64-pc-nto-qnx800 rustc library/core library/alloc library/std
...
error occurred: unknown target `x86_64-pc-nto-qnx800` Ah, do I still have to patch |
I patched cc-rs and it still doesn't know about QNX Neutrino 8.0. What's the best way to build this target right now? |
The patch i use is below. diff --git a/src/target/generated.rs b/src/target/generated.rs
index 0c9b0ae..103bf36 100644
--- a/src/target/generated.rs
+++ b/src/target/generated.rs
@@ -352,6 +352,18 @@ pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[
unversioned_llvm_target: "aarch64-unknown-unknown",
},
),
+ (
+ "aarch64-unknown-nto-qnx800",
+ TargetInfo {
+ full_arch: "aarch64",
+ arch: "aarch64",
+ vendor: "unknown",
+ os: "nto",
+ env: "nto80",
+ abi: "",
+ unversioned_llvm_target: "aarch64-unknown-unknown",
+ },
+ ),
(
"aarch64-unknown-openbsd",
TargetInfo {
@@ -2896,6 +2908,18 @@ pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[
unversioned_llvm_target: "x86_64-pc-unknown",
},
),
+ (
+ "x86_64-pc-nto-qnx800",
+ TargetInfo {
+ full_arch: "x86_64",
+ arch: "x86_64",
+ vendor: "pc",
+ os: "nto",
+ env: "nto80",
+ abi: "",
+ unversioned_llvm_target: "x86_64-pc-unknown",
+ },
+ ), |
OK, I got the QNX Neutrino 8.0 target for x86-64 compiled, but the linker is complaining about Do I need libc patches or something? Have the QNX Neutrino 8.0 targets been compiled/tested and if so, on which platforms were they tested? |
This is known (chicken and egg problem 🐔 🥚) , this can only be solved with a patch on
I have compiled and run both
My understanding is that once the targets are available here the |
Can you post a gist with a list of steps to reproduce so I can verify? Sounds like I need to point to a local copy of cc-rs with some patches (maybe someone can push those somewhere so we can see them ahead of the targets being regenerated) and a patch to point to a local copy of libc (or again, can someone push that somewhere). In the absence of the Rust Project being able to build these targets in CI, I think it's important that the maintainers can at least verify that the target builds OK, and currently I cannot. |
Also, heads up - tomorrow is my last day of work in 2024, so if I can't do a build tomorrow, it'll have to wait until next year or you'll have to find other people with licences to verify this target change. |
Totally agree. @flba-eb Could you do this change ? Since i don't have push access here. |
Please note that so far, QNX targets have always been added even if they were only My proposal:
|
ok, that makes sense - and it matches your table:
For the benefit of anyone who didn't scroll to the bottom of the comments or read the changes to the platform docs, could we edit the PR description to explain which of the four new targets being added has working libstd support, and for those that targets that don't, the follow up steps that are required to enable such support? |
io-sock
network stack and 8.0io-sock
support (libstd) and QNX 8.0 (no_std only)
io-sock
support (libstd) and QNX 8.0 (no_std only)io-sock
+libstd and QNX 8.0 (no_std only)
io-sock
+libstd and QNX 8.0 (no_std only)io-sock
+libstd and QNX 8.0 (no_std
only)
After discussing this with @thejpster and @AkhilTThomas, we came to the conclusion that from our point of view this change can be merged. |
Changes of this pull request:
Refactor code for qnx nto targets to share more code in file
nto_qnx.rs
Add support for an additional network stack on nto qnx 7.1.
QNX 7.1 supports two network stacks:
io-pkt
, which is defaultio-sock
, which is optional on 7.1 but default in QNX 8.0As one can see in the io-sock migration notes, this changes the libc API in a way similar to e.g. linux-gnu vs. linux-musl.
This change adds a new target which has a different value for
target_env
, so that e.g. libc can distinguish between both APIs.Add initial support for QNX 8.0, thanks @AkhilTThomas. As it turned out, the problem with forking many processes still exists in QNX 8.0. Because if this, we are now using it for any QNX version (i.e. not check for
target_env
anymore).@rustbot label +O-neutrino
CC: @jonathanpallant @japaric @gh-tr @AkhilTThomas