-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Changes from all commits
84c8015
efe53dd
62661f2
3f045c9
46a0333
0462826
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,11 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | ||
use crate::spec::Target; | ||
use crate::spec::base::nto_qnx; | ||
|
||
pub(crate) fn target() -> Target { | ||
// In QNX, libc does not provide a compatible ABI between versions. | ||
// To distinguish between QNX versions, we needed a stable conditional compilation switch, | ||
// which is why we needed to implement different targets in the compiler. | ||
Target { | ||
llvm_target: "aarch64-unknown-unknown".into(), | ||
metadata: crate::spec::TargetMetadata { | ||
description: Some("ARM64 QNX Neutrino 7.0 RTOS".into()), | ||
tier: Some(3), | ||
host_tools: Some(false), | ||
std: Some(true), | ||
}, | ||
pointer_width: 64, | ||
// from: https://llvm.org/docs/LangRef.html#data-layout | ||
// e = little endian | ||
// m:e = ELF mangling: Private symbols get a .L prefix | ||
// i8:8:32 = 8-bit-integer, minimum_alignment=8, preferred_alignment=32 | ||
// i16:16:32 = 16-bit-integer, minimum_alignment=16, preferred_alignment=32 | ||
// i64:64 = 64-bit-integer, minimum_alignment=64, preferred_alignment=64 | ||
// i128:128 = 128-bit-integer, minimum_alignment=128, preferred_alignment=128 | ||
// n32:64 = 32 and 64 are native integer widths; Elements of this set are considered to support most general arithmetic operations efficiently. | ||
// S128 = 128 bits are the natural alignment of the stack in bits. | ||
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(), | ||
arch: "aarch64".into(), | ||
options: TargetOptions { | ||
features: "+v8a".into(), | ||
max_atomic_width: Some(128), | ||
pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | ||
"-Vgcc_ntoaarch64le_cxx", | ||
]), | ||
env: "nto70".into(), | ||
..base::nto_qnx::opts() | ||
}, | ||
} | ||
let mut target = nto_qnx::aarch64(); | ||
target.metadata.description = Some("ARM64 QNX Neutrino 7.0 RTOS".into()); | ||
target.options.pre_link_args = | ||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64); | ||
target.options.env = "nto70".into(); | ||
target | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
use crate::spec::Target; | ||
use crate::spec::base::nto_qnx; | ||
|
||
pub(crate) fn target() -> Target { | ||
let mut base = super::aarch64_unknown_nto_qnx700::target(); | ||
base.metadata.description = Some("ARM64 QNX Neutrino 7.1 RTOS".into()); | ||
base.options.env = "nto71".into(); | ||
base | ||
let mut target = nto_qnx::aarch64(); | ||
target.metadata.description = | ||
Some("ARM64 QNX Neutrino 7.1 RTOS with io-pkt network stack".into()); | ||
target.options.pre_link_args = | ||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::Aarch64); | ||
target.options.env = "nto71".into(); | ||
target | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems a comment I thought I lodged went missing. Do these targets usually get built and distributed with a rustc, or do they use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All QNX targets are in Tier 3. One reason is because the Rust Project does not have the licences for the proprietary QNX software developer kit (called QNX SDP), which contains the required C compiler and linker. All the QNX target maintainers here have their own licences, which is why we need to confirm that the target builds and works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes, I should mention that Ferrocene distributes (and qualifies) both QNX Neutrino 7.1.0 targets. I was only thinking about the upstream. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I just wanted to clarify that you distribute the artifacts. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use crate::spec::Target; | ||
use crate::spec::base::nto_qnx; | ||
|
||
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()); | ||
target.options.pre_link_args = | ||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::IoSock, nto_qnx::Arch::Aarch64); | ||
target.options.env = "nto71_iosock".into(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel it is almost a misuse of the field but we could use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel this was already discussed here #133631 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I missed that! |
||
target | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use crate::spec::Target; | ||
use crate::spec::base::nto_qnx; | ||
|
||
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 = "nto80".into(); | ||
target | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,12 @@ | ||
use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | ||
use crate::spec::Target; | ||
use crate::spec::base::nto_qnx; | ||
|
||
pub(crate) fn target() -> Target { | ||
Target { | ||
llvm_target: "x86_64-pc-unknown".into(), | ||
metadata: crate::spec::TargetMetadata { | ||
description: Some("x86 64-bit QNX Neutrino 7.1 RTOS".into()), | ||
tier: Some(3), | ||
host_tools: Some(false), | ||
std: Some(true), | ||
}, | ||
pointer_width: 64, | ||
data_layout: | ||
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(), | ||
arch: "x86_64".into(), | ||
options: TargetOptions { | ||
cpu: "x86-64".into(), | ||
plt_by_default: false, | ||
max_atomic_width: Some(64), | ||
pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | ||
"-Vgcc_ntox86_64_cxx", | ||
]), | ||
env: "nto71".into(), | ||
vendor: "pc".into(), | ||
..base::nto_qnx::opts() | ||
}, | ||
} | ||
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()); | ||
target.options.pre_link_args = | ||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::Default, nto_qnx::Arch::X86_64); | ||
target.options.env = "nto71".into(); | ||
target | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use crate::spec::Target; | ||
use crate::spec::base::nto_qnx; | ||
|
||
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()); | ||
target.options.pre_link_args = | ||
nto_qnx::pre_link_args(nto_qnx::ApiVariant::IoSock, nto_qnx::Arch::X86_64); | ||
target.options.env = "nto71_iosock".into(); | ||
target | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use crate::spec::Target; | ||
use crate::spec::base::nto_qnx; | ||
|
||
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 = "nto80".into(); | ||
target | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does QNX really support AMD Phenoms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at SDP 7.1 (the first with x86-64 support) I don't see anything other than GCC 8.3's baseline x86_64 support. And yeah, some embedded systems are pretty old - Intel Atoms, etc.
Edit:
/host/darwin/x86_64/usr/bin/x86_64-pc-nto-qnx7.1.0-gcc -Q --target=help
shows that it defaults to:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. I thought Intel Atoms support SSSE3? I know they support SSE3, at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not gonna make a big deal about this, I'm just kinda morbidly curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that this PR just refactored this, the settings are exactly the same as before. Unfortunately I cannot say anything about x86 parameters, I'm only using aarch64.