mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
QNX target renaming
- aarch64-unknown-nto-qnx800 becomes simply aarch64-unknown-qnx - x86_64-pc-nto-qnx800 becomes simply x86_64-pc-qnx - references to QNX OS and QNX Neutrino RTOS are replaced with QNX SDP for uniformity - various nto_qnx modules are named to qnx_sdp to match the above The new target names are more consistent with those used by the QNX SDP 8.0 toolchain, and reflect a level on ongoing API stability similar to that for macOS and Linux (which simply have minimum supported versions record for their targets). Once the compiler knows about the new target names, libc and backtrace can be updated to match, and then building libstd for the new targets can be fixed. With these changes I can run: ```console $ ./x build library/std --stage 2 --target x86_64-pc-nto-qnx710,aarch64-unknown-nto-qnx710,x86_64-pc-nto-qnx710_iosock,aarch64-unknown-nto-qnx710_iosock,aarch64-unknown-nto-qnx700 $ ./x build library/core --stage 1 --target x86_64-pc-qnx,aarch64-unknown-qnx ```
This commit is contained in:
@@ -26,8 +26,8 @@ pub(crate) mod managarm_mlibc;
|
||||
pub(crate) mod motor;
|
||||
pub(crate) mod msvc;
|
||||
pub(crate) mod netbsd;
|
||||
pub(crate) mod nto_qnx;
|
||||
pub(crate) mod openbsd;
|
||||
pub(crate) mod qnx_sdp;
|
||||
pub(crate) mod redox;
|
||||
pub(crate) mod solaris;
|
||||
pub(crate) mod solid;
|
||||
|
||||
@@ -1791,10 +1791,10 @@ supported_targets! {
|
||||
("aarch64-unknown-nto-qnx700", aarch64_unknown_nto_qnx700),
|
||||
("aarch64-unknown-nto-qnx710", aarch64_unknown_nto_qnx710),
|
||||
("aarch64-unknown-nto-qnx710_iosock", aarch64_unknown_nto_qnx710_iosock),
|
||||
("aarch64-unknown-nto-qnx800", aarch64_unknown_nto_qnx800),
|
||||
("aarch64-unknown-qnx", aarch64_unknown_qnx),
|
||||
("x86_64-pc-nto-qnx710", x86_64_pc_nto_qnx710),
|
||||
("x86_64-pc-nto-qnx710_iosock", x86_64_pc_nto_qnx710_iosock),
|
||||
("x86_64-pc-nto-qnx800", x86_64_pc_nto_qnx800),
|
||||
("x86_64-pc-qnx", x86_64_pc_qnx),
|
||||
("i686-pc-nto-qnx700", i686_pc_nto_qnx700),
|
||||
|
||||
("aarch64-unknown-linux-ohos", aarch64_unknown_linux_ohos),
|
||||
@@ -1995,6 +1995,7 @@ crate::target_spec_enum! {
|
||||
OpenBsd = "openbsd",
|
||||
Psp = "psp",
|
||||
Psx = "psx",
|
||||
Qnx = "qnx",
|
||||
Qurt = "qurt",
|
||||
Redox = "redox",
|
||||
Rtems = "rtems",
|
||||
@@ -2035,7 +2036,6 @@ crate::target_spec_enum! {
|
||||
Nto70 = "nto70",
|
||||
Nto71 = "nto71",
|
||||
Nto71IoSock = "nto71_iosock",
|
||||
Nto80 = "nto80",
|
||||
Ohos = "ohos",
|
||||
Relibc = "relibc",
|
||||
Sgx = "sgx",
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Env, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = nto_qnx::aarch64();
|
||||
target.metadata.description = Some("ARM64 QNX Neutrino 7.0 RTOS".into());
|
||||
let mut target = qnx_sdp::aarch64();
|
||||
target.metadata.description = Some("ARM64 QNX SDP 7.0".into());
|
||||
target.options.pre_link_args =
|
||||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64);
|
||||
qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::Aarch64);
|
||||
// for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
|
||||
target.options.env = Env::Nto70;
|
||||
target
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Env, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = nto_qnx::aarch64();
|
||||
target.metadata.description =
|
||||
Some("ARM64 QNX Neutrino 7.1 RTOS with io-pkt network stack".into());
|
||||
let mut target = qnx_sdp::aarch64();
|
||||
target.metadata.description = Some("ARM64 QNX SDP 7.1 with io-pkt network stack".into());
|
||||
target.options.pre_link_args =
|
||||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64);
|
||||
qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::Aarch64);
|
||||
// for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
|
||||
target.options.env = Env::Nto71;
|
||||
target
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Env, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = nto_qnx::aarch64();
|
||||
target.metadata.description =
|
||||
Some("ARM64 QNX Neutrino 7.1 RTOS with io-sock network stack".into());
|
||||
let mut target = qnx_sdp::aarch64();
|
||||
target.metadata.description = Some("ARM64 QNX SDP 7.1 with io-sock network stack".into());
|
||||
target.options.pre_link_args =
|
||||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::IoSock, nto_qnx::Arch::Aarch64);
|
||||
qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::IoSock, qnx_sdp::Arch::Aarch64);
|
||||
// for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
|
||||
target.options.env = Env::Nto71IoSock;
|
||||
target
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::{Env, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = nto_qnx::aarch64();
|
||||
target.metadata.description = Some("ARM64 QNX Neutrino 8.0 RTOS".into());
|
||||
target.options.pre_link_args =
|
||||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64);
|
||||
target.options.env = Env::Nto80;
|
||||
target
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Os, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = qnx_sdp::aarch64();
|
||||
target.metadata.description = Some("ARM64 QNX SDP 8.0+".into());
|
||||
target.options.pre_link_args =
|
||||
qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::Aarch64);
|
||||
// for QNX SDP 8.0, we have target_os = "qnx" and no target_env
|
||||
target.options.os = Os::Qnx;
|
||||
target
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Arch, Env, RustcAbi, StackProbeType, Target, TargetOptions, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut meta = nto_qnx::meta();
|
||||
meta.description = Some("32-bit x86 QNX Neutrino 7.0 RTOS".into());
|
||||
let mut meta = qnx_sdp::meta();
|
||||
meta.description = Some("32-bit x86 QNX SDP 7.0".into());
|
||||
meta.std = Some(false);
|
||||
Target {
|
||||
llvm_target: "i586-pc-unknown".into(),
|
||||
@@ -17,14 +17,15 @@ pub(crate) fn target() -> Target {
|
||||
rustc_abi: Some(RustcAbi::X86Sse2),
|
||||
cpu: "pentium4".into(),
|
||||
max_atomic_width: Some(64),
|
||||
pre_link_args: nto_qnx::pre_link_args(
|
||||
nto_qnx::ApiVariant::Default,
|
||||
nto_qnx::Arch::I586,
|
||||
pre_link_args: qnx_sdp::pre_link_args(
|
||||
qnx_sdp::ApiVariant::Default,
|
||||
qnx_sdp::Arch::I586,
|
||||
),
|
||||
// for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
|
||||
env: Env::Nto70,
|
||||
vendor: "pc".into(),
|
||||
stack_probes: StackProbeType::Inline,
|
||||
..base::nto_qnx::opts()
|
||||
..base::qnx_sdp::opts()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Env, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = nto_qnx::x86_64();
|
||||
target.metadata.description =
|
||||
Some("x86 64-bit QNX Neutrino 7.1 RTOS with io-pkt network stack".into());
|
||||
let mut target = qnx_sdp::x86_64();
|
||||
target.metadata.description = Some("x86 64-bit QNX SDP 7.1 with io-pkt network stack".into());
|
||||
target.options.pre_link_args =
|
||||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::X86_64);
|
||||
qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::X86_64);
|
||||
// for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
|
||||
target.options.env = Env::Nto71;
|
||||
target
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Env, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = nto_qnx::x86_64();
|
||||
target.metadata.description =
|
||||
Some("x86 64-bit QNX Neutrino 7.1 RTOS with io-sock network stack".into());
|
||||
let mut target = qnx_sdp::x86_64();
|
||||
target.metadata.description = Some("x86 64-bit QNX SDP 7.1 with io-sock network stack".into());
|
||||
target.options.pre_link_args =
|
||||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::IoSock, nto_qnx::Arch::X86_64);
|
||||
qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::IoSock, qnx_sdp::Arch::X86_64);
|
||||
// for QNX SDP 7.x, we keep target_os = "nto" for backwards compatibility, and use target_env to specify which version
|
||||
target.options.env = Env::Nto71IoSock;
|
||||
target
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
use crate::spec::base::nto_qnx;
|
||||
use crate::spec::{Env, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = nto_qnx::x86_64();
|
||||
target.metadata.description = Some("x86 64-bit QNX Neutrino 8.0 RTOS".into());
|
||||
target.options.pre_link_args =
|
||||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::X86_64);
|
||||
target.options.env = Env::Nto80;
|
||||
target
|
||||
}
|
||||
12
compiler/rustc_target/src/spec/targets/x86_64_pc_qnx.rs
Normal file
12
compiler/rustc_target/src/spec/targets/x86_64_pc_qnx.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use crate::spec::base::qnx_sdp;
|
||||
use crate::spec::{Os, Target};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut target = qnx_sdp::x86_64();
|
||||
target.metadata.description = Some("x86 64-bit QNX SDP 8.0+".into());
|
||||
target.options.pre_link_args =
|
||||
qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default, qnx_sdp::Arch::X86_64);
|
||||
// for QNX SDP 8.0, we have target_os = "qnx" and no target_env
|
||||
target.options.os = Os::Qnx;
|
||||
target
|
||||
}
|
||||
@@ -48,6 +48,7 @@ fn main() {
|
||||
|| target_os == "vita"
|
||||
|| target_os == "aix"
|
||||
|| target_os == "nto"
|
||||
|| target_os == "qnx"
|
||||
|| target_os == "xous"
|
||||
|| target_os == "hurd"
|
||||
|| target_os == "uefi"
|
||||
|
||||
@@ -1096,6 +1096,7 @@ pub mod consts {
|
||||
/// * `"netbsd"`
|
||||
/// * `"nto"`
|
||||
/// * `"openbsd"`
|
||||
/// * `"qnx"`
|
||||
/// * `"redox"`
|
||||
/// * `"solaris"`
|
||||
/// * `"solid_asp3"`
|
||||
|
||||
@@ -733,7 +733,13 @@ fn debug() {
|
||||
// no longer has rounding errors.
|
||||
// VxWorks ignores SO_SNDTIMEO.
|
||||
#[cfg_attr(
|
||||
any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks", target_os = "nto"),
|
||||
any(
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "vxworks",
|
||||
target_os = "nto",
|
||||
target_os = "qnx"
|
||||
),
|
||||
ignore
|
||||
)]
|
||||
#[cfg_attr(target_env = "sgx", ignore)] // FIXME: https://github.com/fortanix/rust-sgx/issues/31
|
||||
|
||||
@@ -188,7 +188,13 @@ fn debug() {
|
||||
// no longer has rounding errors.
|
||||
// VxWorks ignores SO_SNDTIMEO.
|
||||
#[cfg_attr(
|
||||
any(target_os = "netbsd", target_os = "openbsd", target_os = "vxworks", target_os = "nto"),
|
||||
any(
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "vxworks",
|
||||
target_os = "nto",
|
||||
target_os = "qnx"
|
||||
),
|
||||
ignore
|
||||
)]
|
||||
#[cfg_attr(target_os = "wasi", ignore)] // timeout not supported
|
||||
|
||||
@@ -121,7 +121,7 @@ pub mod macos;
|
||||
pub mod motor;
|
||||
#[cfg(target_os = "netbsd")]
|
||||
pub mod netbsd;
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
pub mod nto;
|
||||
#[cfg(target_os = "nuttx")]
|
||||
pub mod nuttx;
|
||||
|
||||
@@ -69,7 +69,7 @@ mod platform {
|
||||
pub use crate::os::linux::*;
|
||||
#[cfg(target_os = "netbsd")]
|
||||
pub use crate::os::netbsd::*;
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
pub use crate::os::nto::*;
|
||||
#[cfg(target_os = "nuttx")]
|
||||
pub use crate::os::nuttx::*;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
target_os = "illumos",
|
||||
target_os = "haiku",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "cygwin"
|
||||
))]
|
||||
use libc::MSG_NOSIGNAL;
|
||||
@@ -36,6 +37,7 @@ use crate::{fmt, io};
|
||||
target_os = "illumos",
|
||||
target_os = "haiku",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "cygwin"
|
||||
)))]
|
||||
const MSG_NOSIGNAL: core::ffi::c_int = 0x0;
|
||||
|
||||
@@ -20,6 +20,7 @@ mod tests;
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin"
|
||||
))]
|
||||
@@ -44,6 +45,7 @@ pub use self::stream::*;
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin",
|
||||
))]
|
||||
|
||||
@@ -6,7 +6,7 @@ cfg_select! {
|
||||
target_os = "openbsd", target_os = "netbsd",
|
||||
target_os = "solaris", target_os = "illumos",
|
||||
target_os = "haiku", target_os = "nto",
|
||||
target_os = "cygwin",
|
||||
target_os = "qnx", target_os = "cygwin",
|
||||
) => {
|
||||
use libc::MSG_NOSIGNAL;
|
||||
}
|
||||
@@ -26,6 +26,7 @@ use super::{SocketAncillary, recv_vectored_with_ancillary_from, send_vectored_wi
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin"
|
||||
))]
|
||||
|
||||
@@ -176,7 +176,7 @@ fn long_path() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(target_os = "nto"))]
|
||||
#[cfg(not(any(target_os = "nto", target_os = "qnx")))]
|
||||
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
|
||||
#[cfg_attr(target_os = "cygwin", ignore)] // Cygwin connect needs handshake
|
||||
#[cfg_attr(target_os = "vxworks", ignore = "Unix sockets are not implemented in VxWorks")]
|
||||
|
||||
@@ -30,7 +30,8 @@ pub(super) use self::impl_apple::peer_cred;
|
||||
target_os = "freebsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "netbsd",
|
||||
target_os = "nto"
|
||||
target_os = "nto",
|
||||
target_os = "qnx"
|
||||
))]
|
||||
pub(super) use self::impl_bsd::peer_cred;
|
||||
#[cfg(any(target_os = "android", target_os = "linux", target_os = "cygwin"))]
|
||||
@@ -79,6 +80,7 @@ mod impl_linux {
|
||||
target_os = "openbsd",
|
||||
target_os = "netbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
))]
|
||||
mod impl_bsd {
|
||||
use super::UCred;
|
||||
|
||||
@@ -16,7 +16,7 @@ cfg_select! {
|
||||
type UserId = u16;
|
||||
type GroupId = u16;
|
||||
}
|
||||
target_os = "nto" => {
|
||||
any(target_os = "nto", target_os = "qnx") => {
|
||||
// Both IDs are signed, see `sys/target_nto.h` of the QNX Neutrino SDP.
|
||||
// Only positive values should be used, see e.g.
|
||||
// https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/s/setuid.html
|
||||
|
||||
@@ -81,6 +81,7 @@ pub fn args() -> Args {
|
||||
target_os = "horizon",
|
||||
target_os = "aix",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "hurd",
|
||||
target_os = "rtems",
|
||||
target_os = "nuttx",
|
||||
|
||||
@@ -224,6 +224,17 @@ pub mod os {
|
||||
pub const EXE_EXTENSION: &str = "";
|
||||
}
|
||||
|
||||
#[cfg(target_os = "qnx")]
|
||||
pub mod os {
|
||||
pub const FAMILY: &str = "unix";
|
||||
pub const OS: &str = "qnx";
|
||||
pub const DLL_PREFIX: &str = "lib";
|
||||
pub const DLL_SUFFIX: &str = ".so";
|
||||
pub const DLL_EXTENSION: &str = "so";
|
||||
pub const EXE_SUFFIX: &str = "";
|
||||
pub const EXE_EXTENSION: &str = "";
|
||||
}
|
||||
|
||||
#[cfg(target_os = "nuttx")]
|
||||
pub mod os {
|
||||
pub const FAMILY: &str = "unix";
|
||||
|
||||
@@ -76,6 +76,7 @@ const fn max_iov() -> usize {
|
||||
target_os = "emscripten",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
))]
|
||||
const fn max_iov() -> usize {
|
||||
libc::UIO_MAXIOV as usize
|
||||
@@ -91,6 +92,7 @@ const fn max_iov() -> usize {
|
||||
target_os = "netbsd",
|
||||
target_os = "nuttx",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "openbsd",
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
@@ -561,6 +563,7 @@ impl FileDesc {
|
||||
target_os = "redox",
|
||||
target_os = "vxworks",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "wasi",
|
||||
)))]
|
||||
pub fn set_cloexec(&self) -> io::Result<()> {
|
||||
@@ -585,6 +588,7 @@ impl FileDesc {
|
||||
target_os = "redox",
|
||||
target_os = "vxworks",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "wasi",
|
||||
))]
|
||||
pub fn set_cloexec(&self) -> io::Result<()> {
|
||||
|
||||
@@ -28,6 +28,7 @@ use libc::fstatat64;
|
||||
target_os = "fuchsia",
|
||||
target_os = "illumos",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "vita",
|
||||
@@ -45,6 +46,7 @@ use libc::readdir as readdir64;
|
||||
target_os = "l4re",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "vita",
|
||||
@@ -282,6 +284,7 @@ cfg_select! {
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vxworks",
|
||||
) => {
|
||||
pub use crate::sys::fs::common::Dir;
|
||||
@@ -410,6 +413,7 @@ fn get_path_from_fd(fd: c_int) -> Option<PathBuf> {
|
||||
target_os = "illumos",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "vita",
|
||||
@@ -436,6 +440,7 @@ pub struct DirEntry {
|
||||
target_os = "illumos",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "vita",
|
||||
@@ -448,6 +453,7 @@ struct dirent64_min {
|
||||
target_os = "illumos",
|
||||
target_os = "aix",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vita",
|
||||
)))]
|
||||
d_type: u8,
|
||||
@@ -462,6 +468,7 @@ struct dirent64_min {
|
||||
target_os = "illumos",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "vita",
|
||||
@@ -611,7 +618,13 @@ impl FileAttr {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "netbsd", target_os = "nto", target_os = "aix", target_os = "wasi")))]
|
||||
#[cfg(not(any(
|
||||
target_os = "netbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "aix",
|
||||
target_os = "wasi"
|
||||
)))]
|
||||
impl FileAttr {
|
||||
#[cfg(not(any(
|
||||
target_os = "vxworks",
|
||||
@@ -736,7 +749,7 @@ impl FileAttr {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "nto", target_os = "wasi"))]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx", target_os = "wasi"))]
|
||||
impl FileAttr {
|
||||
pub fn modified(&self) -> io::Result<SystemTime> {
|
||||
SystemTime::new(self.stat.st_mtim.tv_sec, self.stat.st_mtim.tv_nsec.into())
|
||||
@@ -854,6 +867,7 @@ impl Iterator for ReadDir {
|
||||
target_os = "illumos",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "vita",
|
||||
@@ -927,6 +941,7 @@ impl Iterator for ReadDir {
|
||||
target_os = "illumos",
|
||||
target_os = "aix",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
)))]
|
||||
d_type: (*entry_ptr).d_type as u8,
|
||||
};
|
||||
@@ -952,6 +967,7 @@ impl Iterator for ReadDir {
|
||||
target_os = "illumos",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "solaris",
|
||||
target_os = "vita",
|
||||
@@ -1015,6 +1031,7 @@ impl Drop for DirStream {
|
||||
miri,
|
||||
target_os = "redox",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vita",
|
||||
target_os = "hurd",
|
||||
target_os = "espidf",
|
||||
@@ -1103,6 +1120,7 @@ impl DirEntry {
|
||||
target_os = "vxworks",
|
||||
target_os = "aix",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vita",
|
||||
))]
|
||||
pub fn file_type(&self) -> io::Result<FileType> {
|
||||
@@ -1116,6 +1134,7 @@ impl DirEntry {
|
||||
target_os = "vxworks",
|
||||
target_os = "aix",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vita",
|
||||
)))]
|
||||
pub fn file_type(&self) -> io::Result<FileType> {
|
||||
@@ -1146,6 +1165,7 @@ impl DirEntry {
|
||||
target_os = "l4re",
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "redox",
|
||||
target_os = "rtems",
|
||||
target_os = "solaris",
|
||||
@@ -1205,6 +1225,7 @@ impl DirEntry {
|
||||
target_os = "redox",
|
||||
target_os = "aix",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vita",
|
||||
target_os = "hurd",
|
||||
target_os = "wasi",
|
||||
@@ -1222,6 +1243,7 @@ impl DirEntry {
|
||||
target_os = "redox",
|
||||
target_os = "aix",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vita",
|
||||
target_os = "hurd",
|
||||
target_os = "wasi",
|
||||
@@ -1419,6 +1441,7 @@ impl File {
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "hurd",
|
||||
))]
|
||||
unsafe fn os_datasync(fd: c_int) -> c_int {
|
||||
@@ -1433,6 +1456,7 @@ impl File {
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "hurd",
|
||||
target_vendor = "apple",
|
||||
)))]
|
||||
@@ -2405,6 +2429,7 @@ pub use remove_dir_impl::remove_dir_all;
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vxworks",
|
||||
miri
|
||||
))]
|
||||
@@ -2419,6 +2444,7 @@ mod remove_dir_impl {
|
||||
target_os = "horizon",
|
||||
target_os = "vita",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "vxworks",
|
||||
miri
|
||||
)))]
|
||||
|
||||
@@ -27,6 +27,7 @@ unsafe extern "C" {
|
||||
)]
|
||||
#[cfg_attr(any(target_os = "solaris", target_os = "illumos"), link_name = "___errno")]
|
||||
#[cfg_attr(target_os = "nto", link_name = "__get_errno_ptr")]
|
||||
#[cfg_attr(target_os = "qnx", link_name = "__get_errno_ptr")]
|
||||
#[cfg_attr(any(target_os = "freebsd", target_vendor = "apple"), link_name = "__error")]
|
||||
#[cfg_attr(target_os = "haiku", link_name = "_errnop")]
|
||||
#[cfg_attr(target_os = "aix", link_name = "_Errno")]
|
||||
|
||||
@@ -46,6 +46,7 @@ cfg_select! {
|
||||
target_os = "haiku",
|
||||
target_os = "l4re",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "nuttx",
|
||||
target_vendor = "apple",
|
||||
) => {
|
||||
@@ -66,7 +67,7 @@ cfg_select! {
|
||||
target_os = "openbsd", target_os = "netbsd",
|
||||
target_os = "solaris", target_os = "illumos",
|
||||
target_os = "haiku", target_os = "nto",
|
||||
target_os = "cygwin",
|
||||
target_os = "qnx", target_os = "cygwin",
|
||||
) => {
|
||||
use libc::MSG_NOSIGNAL;
|
||||
}
|
||||
@@ -80,7 +81,7 @@ cfg_select! {
|
||||
target_os = "dragonfly", target_os = "freebsd",
|
||||
target_os = "openbsd", target_os = "netbsd",
|
||||
target_os = "solaris", target_os = "illumos",
|
||||
target_os = "nto",
|
||||
target_os = "nto", target_os = "qnx",
|
||||
) => {
|
||||
use crate::ffi::c_uchar;
|
||||
type IpV4MultiCastType = c_uchar;
|
||||
|
||||
@@ -76,6 +76,7 @@ impl Socket {
|
||||
target_os = "openbsd",
|
||||
target_os = "cygwin",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "solaris",
|
||||
) => {
|
||||
// On platforms that support it we pass the SOCK_CLOEXEC
|
||||
@@ -124,6 +125,7 @@ impl Socket {
|
||||
target_os = "openbsd",
|
||||
target_os = "cygwin",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
) => {
|
||||
// Like above, set cloexec atomically
|
||||
cvt(libc::socketpair(fam, ty | libc::SOCK_CLOEXEC, 0, fds.as_mut_ptr()))?;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use super::Mutex;
|
||||
use crate::cell::UnsafeCell;
|
||||
use crate::pin::Pin;
|
||||
#[cfg(not(target_os = "nto"))]
|
||||
#[cfg(not(any(target_os = "nto", target_os = "qnx")))]
|
||||
use crate::sys::pal::time::TIMESPEC_MAX;
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
use crate::sys::pal::time::TIMESPEC_MAX_CAPPED;
|
||||
use crate::time::Duration;
|
||||
|
||||
@@ -69,10 +69,10 @@ impl Condvar {
|
||||
|
||||
let timeout = Timespec::now(Self::CLOCK).checked_add_duration(&dur);
|
||||
|
||||
#[cfg(not(target_os = "nto"))]
|
||||
#[cfg(not(any(target_os = "nto", target_os = "qnx")))]
|
||||
let timeout = timeout.and_then(|t| t.to_timespec()).unwrap_or(TIMESPEC_MAX);
|
||||
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
let timeout = timeout.and_then(|t| t.to_timespec_capped()).unwrap_or(TIMESPEC_MAX_CAPPED);
|
||||
|
||||
let r = unsafe { libc::pthread_cond_timedwait(self.raw(), mutex, &timeout) };
|
||||
|
||||
@@ -16,7 +16,7 @@ pub const TIMESPEC_MAX: libc::timespec = {
|
||||
|
||||
// This additional constant is only used when calling
|
||||
// `libc::pthread_cond_timedwait`.
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
pub(in crate::sys) const TIMESPEC_MAX_CAPPED: libc::timespec = libc::timespec {
|
||||
tv_sec: (u64::MAX / NSEC_PER_SEC) as i64,
|
||||
tv_nsec: (u64::MAX % NSEC_PER_SEC) as i64,
|
||||
|
||||
@@ -269,7 +269,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
pub fn current_exe() -> io::Result<PathBuf> {
|
||||
let mut e = crate::fs::read("/proc/self/exefile")?;
|
||||
// Current versions of QNX Neutrino provide a null-terminated path.
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::sys::process::PidFd;
|
||||
use crate::{fmt, mem, sys};
|
||||
|
||||
cfg_select! {
|
||||
target_os = "nto" => {
|
||||
any(target_os = "nto", target_os = "qnx") => {
|
||||
use crate::thread;
|
||||
use libc::{c_char, posix_spawn_file_actions_t, posix_spawnattr_t};
|
||||
use crate::time::Duration;
|
||||
@@ -183,7 +183,12 @@ impl Command {
|
||||
|
||||
// Attempts to fork the process. If successful, returns Ok((0, -1))
|
||||
// in the child, and Ok((child_pid, -1)) in the parent.
|
||||
#[cfg(not(any(target_os = "watchos", target_os = "tvos", target_os = "nto")))]
|
||||
#[cfg(not(any(
|
||||
target_os = "watchos",
|
||||
target_os = "tvos",
|
||||
target_os = "nto",
|
||||
target_os = "qnx"
|
||||
)))]
|
||||
unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
|
||||
cvt(libc::fork())
|
||||
}
|
||||
@@ -192,7 +197,7 @@ impl Command {
|
||||
// or closed a file descriptor while the fork() was occurring".
|
||||
// Documentation says "... or try calling fork() again". This is what we do here.
|
||||
// See also https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/f/fork.html
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
|
||||
use crate::sys::io::errno;
|
||||
|
||||
@@ -424,6 +429,7 @@ impl Command {
|
||||
all(target_os = "linux", target_env = "gnu"),
|
||||
all(target_os = "linux", target_env = "musl"),
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin",
|
||||
)))]
|
||||
@@ -443,6 +449,7 @@ impl Command {
|
||||
all(target_os = "linux", target_env = "gnu"),
|
||||
all(target_os = "linux", target_env = "musl"),
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin",
|
||||
))]
|
||||
@@ -550,7 +557,7 @@ impl Command {
|
||||
// or closed a file descriptor while the posix_spawn() was occurring".
|
||||
// Documentation says "... or try calling posix_spawn() again". This is what we do here.
|
||||
// See also http://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/p/posix_spawn.html
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
unsafe fn retrying_libc_posix_spawnp(
|
||||
pid: *mut pid_t,
|
||||
file: *const c_char,
|
||||
@@ -763,9 +770,9 @@ impl Command {
|
||||
let _env_lock = sys::env::env_read_lock();
|
||||
let envp = envp.map(|c| c.as_ptr()).unwrap_or_else(|| *sys::env::environ() as *const _);
|
||||
|
||||
#[cfg(not(target_os = "nto"))]
|
||||
#[cfg(not(any(target_os = "nto", target_os = "qnx")))]
|
||||
let spawn_fn = libc::posix_spawnp;
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
let spawn_fn = retrying_libc_posix_spawnp;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
@@ -822,7 +829,7 @@ impl Command {
|
||||
envp as *const _,
|
||||
);
|
||||
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
let spawn_res = spawn_res?;
|
||||
|
||||
cvt_nz(spawn_res)?;
|
||||
@@ -1202,7 +1209,12 @@ fn signal_string(signal: i32) -> &'static str {
|
||||
)
|
||||
))]
|
||||
libc::SIGSTKFLT => " (SIGSTKFLT)",
|
||||
#[cfg(any(target_os = "linux", target_os = "nto", target_os = "cygwin"))]
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "cygwin"
|
||||
))]
|
||||
libc::SIGPWR => " (SIGPWR)",
|
||||
#[cfg(any(
|
||||
target_os = "freebsd",
|
||||
@@ -1210,6 +1222,7 @@ fn signal_string(signal: i32) -> &'static str {
|
||||
target_os = "openbsd",
|
||||
target_os = "dragonfly",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin",
|
||||
))]
|
||||
|
||||
@@ -54,6 +54,7 @@ cfg_select! {
|
||||
target_os = "hurd",
|
||||
target_os = "l4re",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
) => {
|
||||
mod unix_legacy;
|
||||
pub use unix_legacy::fill_bytes;
|
||||
|
||||
@@ -12,7 +12,12 @@ use crate::mem::{self, DropGuard, ManuallyDrop};
|
||||
use crate::num::NonZero;
|
||||
#[cfg(all(target_os = "linux", target_env = "gnu"))]
|
||||
use crate::sys::weak::dlsym;
|
||||
#[cfg(any(target_os = "solaris", target_os = "illumos", target_os = "nto",))]
|
||||
#[cfg(any(
|
||||
target_os = "solaris",
|
||||
target_os = "illumos",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
))]
|
||||
use crate::sys::weak::weak;
|
||||
use crate::thread::ThreadInit;
|
||||
use crate::time::Duration;
|
||||
|
||||
@@ -193,7 +193,7 @@ unsafe extern "C" {}
|
||||
#[link(name = "unwind")]
|
||||
unsafe extern "C" {}
|
||||
|
||||
#[cfg(target_os = "nto")]
|
||||
#[cfg(any(target_os = "nto", target_os = "qnx"))]
|
||||
cfg_select! {
|
||||
target_env = "nto70" => {
|
||||
#[link(name = "gcc")]
|
||||
|
||||
@@ -39,6 +39,8 @@ const STAGE0_MISSING_TARGETS: &[&str] = &[
|
||||
// just a dummy comment so the list doesn't get onelined
|
||||
"powerpc64-unknown-linux-gnuelfv2",
|
||||
"aarch64-unknown-linux-pauthtest", // Stage 0 compiler is not guaranteed to see the target yet.
|
||||
"aarch64-unknown-qnx",
|
||||
"x86_64-pc-qnx",
|
||||
];
|
||||
|
||||
/// Minimum version threshold for libstdc++ required when using prebuilt LLVM
|
||||
|
||||
@@ -277,7 +277,7 @@ target | std | host | notes
|
||||
[`aarch64-unknown-nto-qnx700`](platform-support/nto-qnx.md) | ? | | ARM64 QNX Neutrino 7.0 RTOS |
|
||||
[`aarch64-unknown-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 7.1 RTOS with default network stack (io-pkt) |
|
||||
[`aarch64-unknown-nto-qnx710_iosock`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 7.1 RTOS with new network stack (io-sock) |
|
||||
[`aarch64-unknown-nto-qnx800`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX Neutrino 8.0 RTOS |
|
||||
[`aarch64-unknown-qnx`](platform-support/nto-qnx.md) | ✓ | | ARM64 QNX SDP 8.0+ |
|
||||
[`aarch64-unknown-nuttx`](platform-support/nuttx.md) | ✓ | | ARM64 with NuttX
|
||||
[`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD
|
||||
[`aarch64-unknown-redox`](platform-support/redox.md) | ✓ | | ARM64 Redox OS
|
||||
@@ -446,7 +446,7 @@ target | std | host | notes
|
||||
[`x86_64-pc-cygwin`](platform-support/x86_64-pc-cygwin.md) | ✓ | | 64-bit x86 Cygwin |
|
||||
[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with default network stack (io-pkt) |
|
||||
[`x86_64-pc-nto-qnx710_iosock`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS with new network stack (io-sock) |
|
||||
[`x86_64-pc-nto-qnx800`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 8.0 RTOS |
|
||||
[`x86_64-pc-qnx`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX SDP 8.0+ |
|
||||
[`x86_64-unikraft-linux-musl`](platform-support/unikraft-linux-musl.md) | ✓ | | 64-bit Unikraft with musl 1.2.5
|
||||
`x86_64-unknown-dragonfly` | ✓ | ✓ | 64-bit DragonFlyBSD
|
||||
`x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
# nto-qnx
|
||||
# Q
|
||||
|
||||
**Tier: 3**
|
||||
|
||||
The [QNX®][qnx.com] Neutrino (nto) Real-time operating system. Known as QNX OS
|
||||
from version 8 onwards.
|
||||
|
||||
This support has been implemented jointly by [Elektrobit Automotive GmbH][Elektrobit]
|
||||
and [QNX][qnx.com].
|
||||
|
||||
[qnx.com]: https://blackberry.qnx.com
|
||||
[Elektrobit]: https://www.elektrobit.com
|
||||
Support for the [QNX®][qnx.com] Software Development Platform (SDP), version 7.0, 7.1 and 8.0.
|
||||
|
||||
## Target maintainers
|
||||
|
||||
@@ -20,36 +13,35 @@ and [QNX][qnx.com].
|
||||
|
||||
## Requirements
|
||||
|
||||
Currently, the following QNX versions and compilation targets are supported:
|
||||
The following QNX SDP versions and compilation targets are supported:
|
||||
|
||||
| Target Tuple | QNX Version | Target Architecture | Full support | `no_std` support |
|
||||
| ----------------------------------- | ----------------------------- | ------------------- | :----------: | :--------------: |
|
||||
| `aarch64-unknown-nto-qnx800` | QNX OS 8.0 | AArch64 | ? | ✓ |
|
||||
| `x86_64-pc-nto-qnx800` | QNX OS 8.0 | x86_64 | ? | ✓ |
|
||||
| `aarch64-unknown-nto-qnx710` | QNX Neutrino 7.1 with io-pkt | AArch64 | ✓ | ✓ |
|
||||
| `x86_64-pc-nto-qnx710` | QNX Neutrino 7.1 with io-pkt | x86_64 | ✓ | ✓ |
|
||||
| `aarch64-unknown-nto-qnx710_iosock` | QNX Neutrino 7.1 with io-sock | AArch64 | ? | ✓ |
|
||||
| `x86_64-pc-nto-qnx710_iosock` | QNX Neutrino 7.1 with io-sock | x86_64 | ? | ✓ |
|
||||
| `aarch64-unknown-nto-qnx700` | QNX Neutrino 7.0 | AArch64 | ? | ✓ |
|
||||
| `i686-pc-nto-qnx700` | QNX Neutrino 7.0 | x86 | | ✓ |
|
||||
| `aarch64-unknown-qnx` | QNX SDP 8.0+ | AArch64 | ? | ✓ |
|
||||
| `x86_64-pc-qnx` | QNX SDP 8.0+ | x86_64 | ? | ✓ |
|
||||
| `aarch64-unknown-nto-qnx710_iosock` | QNX SDP 7.1 with io-sock | AArch64 | ? | ✓ |
|
||||
| `x86_64-pc-nto-qnx710_iosock` | QNX SDP 7.1 with io-sock | x86_64 | ? | ✓ |
|
||||
| `aarch64-unknown-nto-qnx710` | QNX SDP 7.1 with io-pkt | AArch64 | ✓ | ✓ |
|
||||
| `x86_64-pc-nto-qnx710` | QNX SDP 7.1 with io-pkt | x86_64 | ✓ | ✓ |
|
||||
| `aarch64-unknown-nto-qnx700` | QNX SDP 7.0 | AArch64 | ? | ✓ |
|
||||
| `i686-pc-nto-qnx700` | QNX SDP 7.0 | x86 | | ✓ |
|
||||
|
||||
On QNX Neutrino 7.0 and 7.1, `io-pkt` is used as network stack by default.
|
||||
QNX Neutrino 7.1 includes the optional network stack `io-sock`.
|
||||
QNX OS 8.0 always uses `io-sock`. QNX OS 8.0 support is currently work in progress.
|
||||
* On QNX SDP 7.0 and 7.1, `io-pkt` is used as network stack by default.
|
||||
* QNX SDP 7.1 includes the optional network stack `io-sock`.
|
||||
* QNX SDP 8.0 always uses `io-sock`.
|
||||
|
||||
Adding other architectures that are supported by QNX is possible.
|
||||
|
||||
In the table above, 'full support' indicates support for building Rust applications with the full standard library. A '?' means that support is in-progress.
|
||||
'`no_std` support' is for building `#![no_std]` applications where only `core` and `alloc` are available.
|
||||
In the table above, 'full support' indicates support for building Rust applications with the full standard library. A '?' means that support is in-progress. `no_std` support' is for building `#![no_std]` applications where only `core` and `alloc` are available.
|
||||
|
||||
For building or using the Rust toolchain for QNX, the
|
||||
[QNX Software Development Platform (SDP)](https://blackberry.qnx.com/en/products/foundation-software/qnx-software-development-platform)
|
||||
must be installed and initialized.
|
||||
For building or using the Rust toolchain for QNX, the relevant version of the [QNX Software Development Platform (SDP)] must be installed and initialized.
|
||||
Initialization is usually done by sourcing `qnxsdp-env.sh` (this will be installed as part of the SDP, see also installation instruction provided with the SDP).
|
||||
Afterwards [`qcc`](https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.utilities/topic/q/qcc.html) (QNX C/C++ compiler)
|
||||
Afterwards [`qcc`](https://www.qnx.com/developers/docs/8.0/com.qnx.doc.neutrino.utilities/topic/q/qcc.html) (the QNX C/C++ compiler)
|
||||
should be available (in the `$PATH` variable).
|
||||
`qcc` will be called e.g. for linking executables.
|
||||
|
||||
[QNX Software Development Platform (SDP)]: https://qnx.software/en/software/products-and-solutions/qnx-software-development-platform
|
||||
|
||||
When linking `no_std` applications, they must link against `libc.so` (see example). This is
|
||||
required because applications always link against the `crt` library and `crt` depends on `libc.so`.
|
||||
This is done automatically when using the standard library.
|
||||
@@ -71,56 +63,15 @@ Resolution scope for Executable->/bin/sh:
|
||||
libc.so.4->/usr/lib/ldqnx-64.so.2
|
||||
```
|
||||
|
||||
### Small example application
|
||||
|
||||
Small `no_std` example is shown below. Applications using the standard library work as well.
|
||||
|
||||
```rust,ignore (platform-specific)
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(lang_items)]
|
||||
|
||||
// We must always link against libc, even if no external functions are used
|
||||
// "extern C" - Block can be empty but must be present
|
||||
#[link(name = "c")]
|
||||
extern "C" {
|
||||
pub fn printf(format: *const core::ffi::c_char, ...) -> core::ffi::c_int;
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
|
||||
const HELLO: &'static str = "Hello World, the answer is %d\n\0";
|
||||
unsafe {
|
||||
printf(HELLO.as_ptr() as *const _, 42);
|
||||
}
|
||||
0
|
||||
}
|
||||
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_panic: &PanicInfo<'_>) -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[lang = "eh_personality"]
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rust_eh_personality() {}
|
||||
```
|
||||
|
||||
The QNX support in Rust has been tested with QNX Neutrino 7.0 and 7.1. Support for QNX OS 8.0 is a work in progress.
|
||||
|
||||
There are no further known requirements.
|
||||
|
||||
## Conditional compilation
|
||||
|
||||
For conditional compilation, following QNX specific attributes are defined:
|
||||
For conditional compilation, the following QNX specific attributes are defined:
|
||||
|
||||
- `target_os` = `"nto"`
|
||||
- `target_env` = `"nto71"` (for QNX Neutrino 7.1 with "classic" network stack "io_pkt")
|
||||
- `target_env` = `"nto71_iosock"` (for QNX Neutrino 7.1 with network stack "io_sock")
|
||||
- `target_env` = `"nto70"` (for QNX Neutrino 7.0)
|
||||
- `target_env` = `"nto80"` (for QNX OS 8.0)
|
||||
- `target_env` = `"nto70"` (for QNX SDP 7.0)
|
||||
- `target_env` = `"nto71"` (for QNX SDP 7.1 with "classic" network stack "io_pkt")
|
||||
- `target_env` = `"nto71_iosock"` (for QNX SDP 7.1 with "new" network stack "io_sock")
|
||||
- `target_os` = `"qnx"` (for QNX SDP 8.0 or higher)
|
||||
|
||||
## Building the target
|
||||
|
||||
@@ -212,7 +163,7 @@ env $build_env \
|
||||
|
||||
## Building Rust programs
|
||||
|
||||
Rust does not yet ship pre-compiled artifacts for this target.
|
||||
Rust does not ship pre-compiled artifacts for this target.
|
||||
To compile for this target, you must either build Rust with the target enabled (see "Building the target" above),
|
||||
or build your own copy of `core` by using `build-std` or similar.
|
||||
|
||||
|
||||
@@ -638,11 +638,12 @@ fn human_readable_target_os(os: Symbol) -> Option<&'static str> {
|
||||
Motor => "Motor OS",
|
||||
NetBsd => "NetBSD",
|
||||
None => "bare-metal",
|
||||
Nto => "QNX Neutrino",
|
||||
Nto => "QNX SDP 7.x",
|
||||
NuttX => "NuttX",
|
||||
OpenBsd => "OpenBSD",
|
||||
Psp => "Play Station Portable",
|
||||
Psx => "Play Station 1",
|
||||
Qnx => "QNX SDP 8.0+",
|
||||
Qurt => "QuRT",
|
||||
Redox => "Redox OS",
|
||||
Rtems => "RTEMS OS",
|
||||
@@ -718,10 +719,9 @@ fn human_readable_target_env(env: Symbol) -> Option<&'static str> {
|
||||
Msvc => "MSVC",
|
||||
Musl => "musl",
|
||||
Newlib => "Newlib",
|
||||
Nto70 => "Neutrino 7.0",
|
||||
Nto71 => "Neutrino 7.1",
|
||||
Nto71IoSock => "Neutrino 7.1 with io-sock",
|
||||
Nto80 => "Neutrino 8.0",
|
||||
Nto70 => "QNX SDP 7.0",
|
||||
Nto71 => "QNX SDP 7.1",
|
||||
Nto71IoSock => "QNX SDP 7.1 with io-sock",
|
||||
Ohos => "OpenHarmony",
|
||||
P1 => "WASIp1",
|
||||
P2 => "WASIp2",
|
||||
|
||||
@@ -9,7 +9,7 @@ fn gettid() -> u64 {
|
||||
any(target_os = "android", target_os = "linux") => {
|
||||
gettid_linux_like()
|
||||
}
|
||||
target_os = "nto" => {
|
||||
any(target_os = "nto", target_os = "qnx") => {
|
||||
unsafe { libc::gettid() as u64 }
|
||||
}
|
||||
target_os = "openbsd" => {
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
//@ revisions: aarch64_unknown_nto_qnx710_iosock
|
||||
//@ [aarch64_unknown_nto_qnx710_iosock] compile-flags: --target aarch64-unknown-nto-qnx710_iosock
|
||||
//@ [aarch64_unknown_nto_qnx710_iosock] needs-llvm-components: aarch64
|
||||
//@ revisions: aarch64_unknown_nto_qnx800
|
||||
//@ [aarch64_unknown_nto_qnx800] compile-flags: --target aarch64-unknown-nto-qnx800
|
||||
//@ [aarch64_unknown_nto_qnx800] needs-llvm-components: aarch64
|
||||
//@ revisions: aarch64_unknown_qnx
|
||||
//@ [aarch64_unknown_qnx] compile-flags: --target aarch64-unknown-qnx
|
||||
//@ [aarch64_unknown_qnx] needs-llvm-components: aarch64
|
||||
//@ revisions: aarch64_unknown_openbsd
|
||||
//@ [aarch64_unknown_openbsd] compile-flags: --target aarch64-unknown-openbsd
|
||||
//@ [aarch64_unknown_openbsd] needs-llvm-components: aarch64
|
||||
@@ -670,9 +670,9 @@
|
||||
//@ revisions: x86_64_pc_nto_qnx710_iosock
|
||||
//@ [x86_64_pc_nto_qnx710_iosock] compile-flags: --target x86_64-pc-nto-qnx710_iosock
|
||||
//@ [x86_64_pc_nto_qnx710_iosock] needs-llvm-components: x86
|
||||
//@ revisions: x86_64_pc_nto_qnx800
|
||||
//@ [x86_64_pc_nto_qnx800] compile-flags: --target x86_64-pc-nto-qnx800
|
||||
//@ [x86_64_pc_nto_qnx800] needs-llvm-components: x86
|
||||
//@ revisions: x86_64_pc_qnx
|
||||
//@ [x86_64_pc_qnx] compile-flags: --target x86_64-pc-qnx
|
||||
//@ [x86_64_pc_qnx] needs-llvm-components: x86
|
||||
//@ revisions: x86_64_pc_solaris
|
||||
//@ [x86_64_pc_solaris] compile-flags: --target x86_64-pc-solaris
|
||||
//@ [x86_64_pc_solaris] needs-llvm-components: x86
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
target_env = "nto70",
|
||||
target_env = "nto71",
|
||||
target_env = "nto71_iosock",
|
||||
target_env = "nto80",
|
||||
target_env = "ohos",
|
||||
target_env = "relibc",
|
||||
target_env = "sgx",
|
||||
@@ -112,6 +111,7 @@ pub fn bar() {}
|
||||
target_os = "netbsd",
|
||||
target_os = "none",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "nuttx",
|
||||
target_os = "openbsd",
|
||||
target_os = "psp",
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin"
|
||||
)))]
|
||||
@@ -36,6 +37,7 @@ pub fn foo() {}
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
target_os = "cygwin"
|
||||
))]
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
target_os = "linux",
|
||||
target_os = "netbsd",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_os = "openbsd",
|
||||
target_os = "fuchsia",
|
||||
target_os = "managarm",
|
||||
|
||||
@@ -24,7 +24,7 @@ warning: unexpected `cfg` condition value: `does_not_exist`
|
||||
LL | #![cfg(not(target(os = "does_not_exist")))]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qurt`, `redox`, `rtems`, `solaris`, and `solid_asp3` and 14 more
|
||||
= note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qnx`, `qurt`, `redox`, `rtems`, and `solaris` and 15 more
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
LL | target_env = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: expected values for `target_env` are: ``, `gnu`, `macabi`, `mlibc`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `nto71_iosock`, `nto80`, `ohos`, `p1`, `p2`, `p3`, `relibc`, `sgx`, `sim`, `uclibc`, and `v5`
|
||||
= note: expected values for `target_env` are: ``, `gnu`, `macabi`, `mlibc`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `nto71_iosock`, `ohos`, `p1`, `p2`, `p3`, `relibc`, `sgx`, `sim`, `uclibc`, and `v5`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
@@ -210,7 +210,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
LL | target_os = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
|
||||
= note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qnx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
@@ -283,7 +283,7 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
|
||||
| |
|
||||
| help: there is a expected value with a similar name: `"linux"`
|
||||
|
|
||||
= note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
|
||||
= note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qnx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: 29 warnings emitted
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
target_os = "solaris",
|
||||
target_os = "vxworks",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
))]
|
||||
mod m {
|
||||
|
||||
@@ -31,9 +31,9 @@ fn main() {
|
||||
thread::sleep_ms(5000);
|
||||
process::exit(1);
|
||||
});
|
||||
// QNX Neutrino does not have `yes`. Therefore, use `while-echo` for `nto`
|
||||
// QNX does not have `yes`. Therefore, use `while-echo` for `nto`
|
||||
// and `yes` for other platforms.
|
||||
let command = if cfg!(target_os = "nto") {
|
||||
let command = if cfg!(any(target_os = "nto", target_os = "qnx")) {
|
||||
"while echo y ; do : ; done | head"
|
||||
} else {
|
||||
"yes | head"
|
||||
|
||||
@@ -36,6 +36,7 @@ struct Outer {
|
||||
target_os = "solaris",
|
||||
target_os = "vxworks",
|
||||
target_os = "nto",
|
||||
target_os = "qnx",
|
||||
target_vendor = "apple",
|
||||
))]
|
||||
mod m {
|
||||
|
||||
Reference in New Issue
Block a user