Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1790,10 +1790,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),
Expand Down Expand Up @@ -1994,6 +1994,7 @@ crate::target_spec_enum! {
OpenBsd = "openbsd",
Psp = "psp",
Psx = "psx",
Qnx = "qnx",
Qurt = "qurt",
Redox = "redox",
Rtems = "rtems",
Expand Down Expand Up @@ -2034,7 +2035,6 @@ crate::target_spec_enum! {
Nto70 = "nto70",
Nto71 = "nto71",
Nto71IoSock = "nto71_iosock",
Nto80 = "nto80",
Ohos = "ohos",
Relibc = "relibc",
Sgx = "sgx",
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}

This file was deleted.

12 changes: 12 additions & 0 deletions compiler/rustc_target/src/spec/targets/aarch64_unknown_qnx.rs
Comment thread
jonathanpallant marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -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
}
15 changes: 8 additions & 7 deletions compiler/rustc_target/src/spec/targets/i686_pc_nto_qnx700.rs
Original file line number Diff line number Diff line change
@@ -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(),
Expand All @@ -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()
},
}
}
10 changes: 5 additions & 5 deletions compiler/rustc_target/src/spec/targets/x86_64_pc_nto_qnx710.rs
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
11 changes: 0 additions & 11 deletions compiler/rustc_target/src/spec/targets/x86_64_pc_nto_qnx800.rs

This file was deleted.

12 changes: 12 additions & 0 deletions compiler/rustc_target/src/spec/targets/x86_64_pc_qnx.rs
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions library/std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ pub mod consts {
/// * `"netbsd"`
/// * `"nto"`
/// * `"openbsd"`
/// * `"qnx"`
/// * `"redox"`
/// * `"solaris"`
/// * `"solid_asp3"`
Expand Down
8 changes: 7 additions & 1 deletion library/std/src/net/tcp/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion library/std/src/net/udp/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/os/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/os/unix/net/datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
target_os = "illumos",
target_os = "haiku",
target_os = "nto",
target_os = "qnx",
target_os = "cygwin"
))]
use libc::MSG_NOSIGNAL;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/os/unix/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ mod tests;
target_os = "netbsd",
target_os = "openbsd",
target_os = "nto",
target_os = "qnx",
target_vendor = "apple",
target_os = "cygwin"
))]
Expand All @@ -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",
))]
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/os/unix/net/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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"
))]
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/os/unix/net/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
4 changes: 3 additions & 1 deletion library/std/src/os/unix/net/ucred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/os/unix/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys/args/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions library/std/src/sys/env_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading
Loading