Skip to content

Commit 08c4cc9

Browse files
authored
Unrolled build for rust-lang#130549
Rollup merge of rust-lang#130549 - biabbas:riscv32_wrs_vxworks, r=nnethercote Add RISC-V vxworks targets Risc-V 32 and RISC-V 64 targets are to be added in the target list.
2 parents 4c62024 + 6d229f8 commit 08c4cc9

File tree

12 files changed

+66
-5
lines changed

12 files changed

+66
-5
lines changed

compiler/rustc_target/src/spec/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1840,6 +1840,8 @@ supported_targets! {
18401840
("powerpc-wrs-vxworks", powerpc_wrs_vxworks),
18411841
("powerpc-wrs-vxworks-spe", powerpc_wrs_vxworks_spe),
18421842
("powerpc64-wrs-vxworks", powerpc64_wrs_vxworks),
1843+
("riscv32-wrs-vxworks", riscv32_wrs_vxworks),
1844+
("riscv64-wrs-vxworks", riscv64_wrs_vxworks),
18431845

18441846
("aarch64-kmc-solid_asp3", aarch64_kmc_solid_asp3),
18451847
("armv7a-kmc-solid_asp3-eabi", armv7a_kmc_solid_asp3_eabi),

compiler/rustc_target/src/spec/targets/aarch64_wrs_vxworks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
description: None,
88
tier: Some(3),
99
host_tools: Some(false),
10-
std: None, // ?
10+
std: Some(true),
1111
},
1212
pointer_width: 64,
1313
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),

compiler/rustc_target/src/spec/targets/i686_wrs_vxworks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
1313
description: None,
1414
tier: Some(3),
1515
host_tools: Some(false),
16-
std: None, // ?
16+
std: Some(true),
1717
},
1818
pointer_width: 32,
1919
data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\

compiler/rustc_target/src/spec/targets/powerpc64_wrs_vxworks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
1414
description: None,
1515
tier: Some(3),
1616
host_tools: Some(false),
17-
std: None, // ?
17+
std: Some(true),
1818
},
1919
pointer_width: 64,
2020
data_layout: "E-m:e-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),

compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
1313
description: None,
1414
tier: Some(3),
1515
host_tools: Some(false),
16-
std: None, // ?
16+
std: Some(true),
1717
},
1818
pointer_width: 32,
1919
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use crate::spec::{StackProbeType, Target, TargetOptions, base};
2+
3+
pub(crate) fn target() -> Target {
4+
Target {
5+
llvm_target: "riscv32".into(),
6+
metadata: crate::spec::TargetMetadata {
7+
description: None,
8+
tier: Some(3),
9+
host_tools: Some(false),
10+
std: Some(true),
11+
},
12+
pointer_width: 32,
13+
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
14+
arch: "riscv32".into(),
15+
options: TargetOptions {
16+
cpu: "generic-rv32".into(),
17+
llvm_abiname: "ilp32d".into(),
18+
max_atomic_width: Some(32),
19+
features: "+m,+a,+f,+d,+c".into(),
20+
stack_probes: StackProbeType::Inline,
21+
..base::vxworks::opts()
22+
},
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use crate::spec::{StackProbeType, Target, TargetOptions, base};
2+
3+
pub(crate) fn target() -> Target {
4+
Target {
5+
llvm_target: "riscv64".into(),
6+
metadata: crate::spec::TargetMetadata {
7+
description: None,
8+
tier: Some(3),
9+
host_tools: Some(false),
10+
std: Some(true),
11+
},
12+
pointer_width: 64,
13+
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
14+
arch: "riscv64".into(),
15+
options: TargetOptions {
16+
cpu: "generic-rv64".into(),
17+
llvm_abiname: "lp64d".into(),
18+
max_atomic_width: Some(64),
19+
features: "+m,+a,+f,+d,+c".into(),
20+
stack_probes: StackProbeType::Inline,
21+
..base::vxworks::opts()
22+
},
23+
}
24+
}

compiler/rustc_target/src/spec/targets/x86_64_wrs_vxworks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
description: None,
1616
tier: Some(3),
1717
host_tools: Some(false),
18-
std: None, // ?
18+
std: Some(true),
1919
},
2020
pointer_width: 64,
2121
data_layout:

library/std/src/sys/alloc/unix.rs

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ cfg_if::cfg_if! {
7171
}
7272
} else {
7373
#[inline]
74+
#[cfg_attr(target_os = "vxworks", allow(unused_unsafe))]
7475
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
7576
let mut out = ptr::null_mut();
7677
// We prefer posix_memalign over aligned_alloc since it is more widely available, and

src/doc/rustc/src/platform-support.md

+2
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,14 @@ target | std | host | notes
358358
[`riscv32imc-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF
359359
[`riscv32imac-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF
360360
[`riscv32imafc-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF
361+
[`riscv32-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
361362
[`riscv64gc-unknown-hermit`](platform-support/hermit.md) | ✓ | | RISC-V Hermit
362363
`riscv64gc-unknown-freebsd` | | | RISC-V FreeBSD
363364
`riscv64gc-unknown-fuchsia` | | | RISC-V Fuchsia
364365
[`riscv64gc-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | RISC-V NetBSD
365366
[`riscv64gc-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/riscv64
366367
[`riscv64-linux-android`](platform-support/android.md) | | | RISC-V 64-bit Android
368+
[`riscv64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
367369
`s390x-unknown-linux-musl` | | | S390x Linux (kernel 3.2, musl 1.2.3)
368370
`sparc-unknown-linux-gnu` | ✓ | | 32-bit SPARC Linux
369371
[`sparc-unknown-none-elf`](./platform-support/sparc-unknown-none-elf.md) | * | | Bare 32-bit SPARC V7+

src/doc/rustc/src/platform-support/vxworks.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Target triplets available:
1414
- `powerpc-wrs-vxworks`
1515
- `powerpc64-wrs-vxworks`
1616
- `powerpc-wrs-vxworks-spe`
17+
- `riscv32-wrs-vxworks`
18+
- `riscv64-wrs-vxworks`
1719

1820
## Target maintainers
1921

tests/assembly/targets/targets-elf.rs

+6
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@
372372
//@ revisions: powerpc_wrs_vxworks_spe
373373
//@ [powerpc_wrs_vxworks_spe] compile-flags: --target powerpc-wrs-vxworks-spe
374374
//@ [powerpc_wrs_vxworks_spe] needs-llvm-components: powerpc
375+
//@ revisions: riscv32_wrs_vxworks
376+
//@ [riscv32_wrs_vxworks] compile-flags: --target riscv32-wrs-vxworks
377+
//@ [riscv32_wrs_vxworks] needs-llvm-components: riscv
375378
//@ revisions: riscv32gc_unknown_linux_gnu
376379
//@ [riscv32gc_unknown_linux_gnu] compile-flags: --target riscv32gc-unknown-linux-gnu
377380
//@ [riscv32gc_unknown_linux_gnu] needs-llvm-components: riscv
@@ -414,6 +417,9 @@
414417
//@ revisions: riscv64_linux_android
415418
//@ [riscv64_linux_android] compile-flags: --target riscv64-linux-android
416419
//@ [riscv64_linux_android] needs-llvm-components: riscv
420+
//@ revisions: riscv64_wrs_vxworks
421+
//@ [riscv64_wrs_vxworks] compile-flags: --target riscv64-wrs-vxworks
422+
//@ [riscv64_wrs_vxworks] needs-llvm-components: riscv
417423
//@ revisions: riscv64gc_unknown_freebsd
418424
//@ [riscv64gc_unknown_freebsd] compile-flags: --target riscv64gc-unknown-freebsd
419425
//@ [riscv64gc_unknown_freebsd] needs-llvm-components: riscv

0 commit comments

Comments
 (0)