Skip to content

Commit b731131

Browse files
authored
Rollup merge of rust-lang#63604 - Wind-River:master, r=alexcrichton
Some update for vxWorks 1. support crt-static 2. change armv7_wrs_vxworks to armv7_wrs_vxworks_eabihf. 3. change vx-cxx to wr-c++, vx-ar to wr-ar and vx-run to wr-run. 4. code cleanup r? @alexcrichton
2 parents c53ce3b + 403e672 commit b731131

18 files changed

+25
-202
lines changed

src/bootstrap/cc_detect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn cc2ar(cc: &Path, target: &str) -> Option<PathBuf> {
4646
} else if target.contains("openbsd") {
4747
Some(PathBuf::from("ar"))
4848
} else if target.contains("vxworks") {
49-
Some(PathBuf::from("vx-ar"))
49+
Some(PathBuf::from("wr-ar"))
5050
} else {
5151
let parent = cc.parent().unwrap();
5252
let file = cc.file_name().unwrap().to_str().unwrap();

src/librustc_target/spec/aarch64_wrs_vxworks.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ pub fn target() -> TargetResult {
99
target_endian: "little".to_string(),
1010
target_pointer_width: "64".to_string(),
1111
target_c_int_width: "32".to_string(),
12-
target_env: "gnu".to_string(),
1312
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".to_string(),
1413
arch: "aarch64".to_string(),
1514
target_os: "vxworks".to_string(),
16-
target_vendor: "unknown".to_string(),
15+
target_env: "gnu".to_string(),
16+
target_vendor: "wrs".to_string(),
1717
linker_flavor: LinkerFlavor::Gcc,
1818
options: TargetOptions {
1919
abi_blacklist: super::arm_base::abi_blacklist(),
20-
target_mcount: "\u{1}_mcount".to_string(),
2120
.. base
2221
},
2322
})

src/librustc_target/spec/arm_wrs_vxworks_sf.rs

-25
This file was deleted.

src/librustc_target/spec/armv7_wrs_vxworks.rs

-31
This file was deleted.

src/librustc_target/spec/arm_wrs_vxworks.rs src/librustc_target/spec/armv7_wrs_vxworks_eabihf.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use crate::spec::{LinkerFlavor, Target, TargetOptions, TargetResult};
22

3-
// This target is for glibc Linux on ARMv7 without NEON or
4-
// thumb-mode. See the thumbv7neon variant for enabling both.
5-
63
pub fn target() -> TargetResult {
74
let base = super::vxworks_base::opts();
85
Ok(Target {
@@ -14,17 +11,14 @@ pub fn target() -> TargetResult {
1411
arch: "arm".to_string(),
1512
target_os: "vxworks".to_string(),
1613
target_env: "gnu".to_string(),
17-
target_vendor: "unknown".to_string(),
14+
target_vendor: "wrs".to_string(),
1815
linker_flavor: LinkerFlavor::Gcc,
19-
2016
options: TargetOptions {
2117
// Info about features at https://wiki.debian.org/ArmHardFloatPort
2218
features: "+v7,+vfp3,-d32,+thumb2,-neon".to_string(),
2319
cpu: "generic".to_string(),
2420
max_atomic_width: Some(64),
2521
abi_blacklist: super::arm_base::abi_blacklist(),
26-
target_mcount: "\u{1}__gnu_mcount_nc".to_string(),
27-
position_independent_executables: false,
2822
.. base
2923
}
3024
})

src/librustc_target/spec/i586_wrs_vxworks.rs

-8
This file was deleted.

src/librustc_target/spec/i686_wrs_vxworks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn target() -> TargetResult {
1616
arch: "x86".to_string(),
1717
target_os: "vxworks".to_string(),
1818
target_env: "gnu".to_string(),
19-
target_vendor: "unknown".to_string(),
19+
target_vendor: "wrs".to_string(),
2020
linker_flavor: LinkerFlavor::Gcc,
2121
options: base,
2222
})

src/librustc_target/spec/i686_wrs_vxworks_gnu.rs

-23
This file was deleted.

src/librustc_target/spec/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,9 @@ supported_targets! {
493493

494494
("nvptx64-nvidia-cuda", nvptx64_nvidia_cuda),
495495

496-
("x86_64-wrs-vxworks", x86_64_wrs_vxworks),
497496
("i686-wrs-vxworks", i686_wrs_vxworks),
498-
("i586-wrs-vxworks", i586_wrs_vxworks),
499-
("armv7-wrs-vxworks", armv7_wrs_vxworks),
497+
("x86_64-wrs-vxworks", x86_64_wrs_vxworks),
498+
("armv7-wrs-vxworks-eabihf", armv7_wrs_vxworks_eabihf),
500499
("aarch64-wrs-vxworks", aarch64_wrs_vxworks),
501500
("powerpc-wrs-vxworks", powerpc_wrs_vxworks),
502501
("powerpc-wrs-vxworks-spe", powerpc_wrs_vxworks_spe),

src/librustc_target/spec/powerpc64_wrs_vxworks.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ pub fn target() -> TargetResult {
1515
arch: "powerpc64".to_string(),
1616
target_os: "vxworks".to_string(),
1717
target_env: "gnu".to_string(),
18-
target_vendor: "unknown".to_string(),
18+
target_vendor: "wrs".to_string(),
1919
linker_flavor: LinkerFlavor::Gcc,
2020
options: TargetOptions {
21-
target_mcount: "_mcount".to_string(),
2221
.. base
2322
},
2423
})

src/librustc_target/spec/powerpc64_wrs_vxworks_gnusf.rs

-26
This file was deleted.

src/librustc_target/spec/powerpc_wrs_vxworks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub fn target() -> TargetResult {
1919
linker_flavor: LinkerFlavor::Gcc,
2020
options: TargetOptions {
2121
features: "+secure-plt".to_string(),
22-
target_mcount: "_mcount".to_string(),
2322
.. base
2423
},
2524
})

src/librustc_target/spec/powerpc_wrs_vxworks_gnusf.rs

-26
This file was deleted.

src/librustc_target/spec/powerpc_wrs_vxworks_gnuspesf.rs

-27
This file was deleted.

src/librustc_target/spec/powerpc_wrs_vxworks_spe.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub fn target() -> TargetResult {
2020
options: TargetOptions {
2121
// feature msync would disable instruction 'fsync' which is not supported by fsl_p1p2
2222
features: "+secure-plt,+msync".to_string(),
23-
target_mcount: "_mcount".to_string(),
2423
.. base
2524
},
2625
})
+13-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions, RelroLevel};
1+
use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions};
22
use std::default::Default;
33

44
pub fn opts() -> TargetOptions {
5+
let mut args_crt = LinkArgs::new();
6+
args_crt.insert(LinkerFlavor::Gcc, vec![
7+
"--static-crt".to_string(),
8+
]);
59
let mut args = LinkArgs::new();
610
args.insert(LinkerFlavor::Gcc, vec![
711
// We want to be able to strip as much executable code as possible
@@ -12,30 +16,25 @@ pub fn opts() -> TargetOptions {
1216
// following libraries so we're sure to pass it as one of the first
1317
// arguments.
1418
"-Wl,--as-needed".to_string(),
15-
16-
// Always enable NX protection when it is available
17-
"-Wl,-z,noexecstack".to_string(),
18-
]);
19-
20-
let mut late_lk_args = LinkArgs::new();
21-
late_lk_args.insert(LinkerFlavor::Gcc, vec![
22-
"-lnet".to_string(),
23-
"-lunix".to_string(),
2419
]);
2520

2621
TargetOptions {
27-
linker: Some("vx-cxx".to_string()),
22+
linker: Some("wr-c++".to_string()),
2823
exe_suffix: ".vxe".to_string(),
29-
late_link_args: late_lk_args,
3024
dynamic_linking: true,
3125
executables: true,
3226
target_family: Some("unix".to_string()),
3327
linker_is_gnu: true,
3428
has_rpath: true,
3529
pre_link_args: args,
36-
position_independent_executables: true,
37-
relro_level: RelroLevel::Full,
30+
position_independent_executables: false,
3831
has_elf_tls: true,
32+
pre_link_args_crt: args_crt,
33+
crt_static_default: true,
34+
crt_static_respected: true,
35+
crt_static_allows_dylibs: true,
36+
// VxWorks needs to implement this to support profiling
37+
target_mcount: "_mcount".to_string(),
3938
.. Default::default()
4039
}
4140
}

src/librustc_target/spec/x86_64_wrs_vxworks.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub fn target() -> TargetResult {
66
base.max_atomic_width = Some(64);
77
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
88
base.stack_probes = true;
9+
base.disable_redzone = true;
910

1011
Ok(Target {
1112
llvm_target: "x86_64-unknown-linux-gnu".to_string(),

src/tools/compiletest/src/runtest.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1659,10 +1659,10 @@ impl<'test> TestCx<'test> {
16591659
_ if self.config.target.contains("vxworks") => {
16601660
let aux_dir = self.aux_output_dir_name();
16611661
let ProcArgs { prog, args } = self.make_run_args();
1662-
let mut vx_run = Command::new("vx-run");
1663-
vx_run.args(&[&prog]).args(args).envs(env.clone());
1662+
let mut wr_run = Command::new("wr-run");
1663+
wr_run.args(&[&prog]).args(args).envs(env.clone());
16641664
self.compose_and_run(
1665-
vx_run,
1665+
wr_run,
16661666
self.config.run_lib_path.to_str().unwrap(),
16671667
Some(aux_dir.to_str().unwrap()),
16681668
None,

0 commit comments

Comments
 (0)