-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #61946 - BaoshanPang:vxworks, r=alexcrichton
port rust for vxWorks The supporting for vxWorks has been enabled in this branch. Although there are still a lots of work to do, I would like to upstream the code and fix the problems later. Please let me know if there is anything I have to do before upstream the code. r? @alexcrichton Thanks, Baoshan
- Loading branch information
Showing
69 changed files
with
8,791 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.max_atomic_width = Some(128); | ||
|
||
Ok(Target { | ||
llvm_target: "aarch64-unknown-linux-gnu".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
target_env: "gnu".to_string(), | ||
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(), | ||
arch: "aarch64".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
abi_blacklist: super::arm_base::abi_blacklist(), | ||
target_mcount: "\u{1}_mcount".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
// This target is for glibc Linux on ARMv7 without NEON or | ||
// thumb-mode. See the thumbv7neon variant for enabling both. | ||
|
||
pub fn target() -> TargetResult { | ||
let base = super::vxworks_base::opts(); | ||
Ok(Target { | ||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), | ||
arch: "arm".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
|
||
options: TargetOptions { | ||
// Info about features at https://wiki.debian.org/ArmHardFloatPort | ||
features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), | ||
cpu: "generic".to_string(), | ||
max_atomic_width: Some(64), | ||
abi_blacklist: super::arm_base::abi_blacklist(), | ||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(), | ||
// tls_model: "local-exec".to_string(), | ||
position_independent_executables: false, | ||
.. base | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.max_atomic_width = Some(64); | ||
Ok(Target { | ||
llvm_target: "arm-unknown-linux-gnueabi".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), | ||
arch: "arm".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
|
||
options: TargetOptions { | ||
features: "+strict-align,+v6".to_string(), | ||
abi_blacklist: super::arm_base::abi_blacklist(), | ||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
// This target is for glibc Linux on ARMv7 without NEON or | ||
// thumb-mode. See the thumbv7neon variant for enabling both. | ||
|
||
pub fn target() -> TargetResult { | ||
let base = super::vxworks_base::opts(); | ||
Ok(Target { | ||
llvm_target: "armv7-unknown-linux-gnueabihf".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64".to_string(), | ||
arch: "arm".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
|
||
options: TargetOptions { | ||
// Info about features at https://wiki.debian.org/ArmHardFloatPort | ||
features: "+v7,+vfp3,+d16,+thumb2,-neon".to_string(), | ||
cpu: "generic".to_string(), | ||
max_atomic_width: Some(64), | ||
abi_blacklist: super::arm_base::abi_blacklist(), | ||
target_mcount: "\u{1}__gnu_mcount_nc".to_string(), | ||
// tls_model: "local-exec".to_string(), | ||
position_independent_executables: false, | ||
.. base | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use crate::spec::TargetResult; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::i686_wrs_vxworks::target()?; | ||
base.options.cpu = "pentium".to_string(); | ||
base.llvm_target = "i586-unknown-linux-gnu".to_string(); | ||
Ok(base) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.cpu = "pentium4".to_string(); | ||
base.max_atomic_width = Some(64); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string()); | ||
base.stack_probes = true; | ||
|
||
Ok(Target { | ||
llvm_target: "i686-unknown-linux-gnu".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(), | ||
arch: "x86".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: base, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.cpu = "pentium4".to_string(); | ||
base.max_atomic_width = Some(64); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string()); | ||
base.stack_probes = true; | ||
|
||
Ok(Target { | ||
llvm_target: "i686-unknown-linux-gnu".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(), | ||
arch: "x86".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: base, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.cpu = "ppc64".to_string(); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); | ||
base.max_atomic_width = Some(64); | ||
|
||
Ok(Target { | ||
llvm_target: "powerpc64-unknown-linux-gnu".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "E-m:e-i64:64-n32:64".to_string(), | ||
arch: "powerpc64".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
target_mcount: "_mcount".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.cpu = "ppc64".to_string(); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); | ||
base.max_atomic_width = Some(64); | ||
|
||
Ok(Target { | ||
llvm_target: "powerpc64-unknown-linux-gnu".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "E-m:e-i64:64-n32:64".to_string(), | ||
arch: "powerpc64".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "unknown".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
features: "-hard-float".to_string(), | ||
target_mcount: "_mcount".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string()); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("--secure-plt".to_string()); | ||
base.max_atomic_width = Some(32); | ||
|
||
Ok(Target { | ||
llvm_target: "powerpc-unknown-linux-gnu".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(), | ||
arch: "powerpc".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "wrs".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
features: "+secure-plt".to_string(), | ||
target_mcount: "_mcount".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string()); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("--secure-plt".to_string()); | ||
base.max_atomic_width = Some(32); | ||
|
||
Ok(Target { | ||
llvm_target: "powerpc-unknown-linux-gnu".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(), | ||
arch: "powerpc".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "wrs".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
features: "+secure-plt,-hard-float".to_string(), | ||
target_mcount: "_mcount".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mspe".to_string()); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("--secure-plt".to_string()); | ||
base.max_atomic_width = Some(32); | ||
|
||
Ok(Target { | ||
llvm_target: "powerpc-unknown-linux-gnuspe".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(), | ||
arch: "powerpc".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "wrs".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
// feature msync would disable instruction 'fsync' which is not supported by fsl_p1p2 | ||
features: "+secure-plt,+msync,-hard-float".to_string(), | ||
target_mcount: "_mcount".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult}; | ||
|
||
pub fn target() -> TargetResult { | ||
let mut base = super::vxworks_base::opts(); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mspe".to_string()); | ||
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("--secure-plt".to_string()); | ||
base.max_atomic_width = Some(32); | ||
|
||
Ok(Target { | ||
llvm_target: "powerpc-unknown-linux-gnuspe".to_string(), | ||
target_endian: "big".to_string(), | ||
target_pointer_width: "32".to_string(), | ||
target_c_int_width: "32".to_string(), | ||
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(), | ||
arch: "powerpc".to_string(), | ||
target_os: "vxworks".to_string(), | ||
target_env: "gnu".to_string(), | ||
target_vendor: "wrs".to_string(), | ||
linker_flavor: LinkerFlavor::Gcc, | ||
options: TargetOptions { | ||
// feature msync would disable instruction 'fsync' which is not supported by fsl_p1p2 | ||
features: "+secure-plt,+msync".to_string(), | ||
target_mcount: "_mcount".to_string(), | ||
.. base | ||
}, | ||
}) | ||
} |
Oops, something went wrong.