Skip to content

Commit e517385

Browse files
committed
add (shimmed) std support for armv7a-vex-v5
1 parent 26f472d commit e517385

File tree

6 files changed

+40
-1
lines changed

6 files changed

+40
-1
lines changed

library/std/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ wasi = { version = "0.11.0", features = [
9090
r-efi = { version = "4.5.0", features = ['rustc-dep-of-std'] }
9191
r-efi-alloc = { version = "1.0.0", features = ['rustc-dep-of-std'] }
9292

93+
[target.'cfg(target_os = "vexos")'.dependencies]
94+
vex-sdk = { version = "0.16.1", features = ['rustc-dep-of-std'] }
95+
9396
[features]
9497
backtrace = [
9598
'addr2line/rustc-dep-of-std',

library/std/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ fn main() {
5656
|| target_os == "zkvm"
5757
|| target_os == "rtems"
5858
|| target_os == "nuttx"
59+
|| target_os == "vexos"
5960

6061
// See src/bootstrap/src/core/build_steps/synthetic_targets.rs
6162
|| env::var("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET").is_ok()

library/std/src/sys/pal/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ cfg_if::cfg_if! {
6161
} else if #[cfg(target_os = "zkvm")] {
6262
mod zkvm;
6363
pub use self::zkvm::*;
64+
} else if #[cfg(target_os = "vexos")] {
65+
mod vexos;
66+
pub use self::vexos::*;
6467
} else {
6568
mod unsupported;
6669
pub use self::unsupported::*;

library/std/src/sys/pal/vexos/mod.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#[path = "../unsupported/alloc.rs"]
2+
pub mod alloc;
3+
#[path = "../unsupported/args.rs"]
4+
pub mod args;
5+
#[path = "../unsupported/env.rs"]
6+
pub mod env;
7+
#[path = "../unsupported/fs.rs"]
8+
pub mod fs;
9+
#[path = "../unsupported/io.rs"]
10+
pub mod io;
11+
#[path = "../unsupported/net.rs"]
12+
pub mod net;
13+
#[path = "../unsupported/os.rs"]
14+
pub mod os;
15+
#[path = "../unsupported/pipe.rs"]
16+
pub mod pipe;
17+
#[path = "../unsupported/process.rs"]
18+
pub mod process;
19+
#[path = "../unsupported/stdio.rs"]
20+
pub mod stdio;
21+
#[path = "../unsupported/thread.rs"]
22+
pub mod thread;
23+
#[path = "../unsupported/thread_local_key.rs"]
24+
pub mod thread_local_key;
25+
#[path = "../unsupported/time.rs"]
26+
pub mod time;
27+
28+
#[path = "../unsupported/common.rs"]
29+
#[deny(unsafe_op_in_unsafe_fn)]
30+
mod common;
31+
pub use common::*;

src/bootstrap/src/core/sanity.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub struct Finder {
3333
//
3434
// Targets can be removed from this list once they are present in the stage0 compiler (usually by updating the beta compiler of the bootstrap).
3535
const STAGE0_MISSING_TARGETS: &[&str] = &[
36+
"armv7a-vex-v5",
3637
// just a dummy comment so the list doesn't get onelined
3738
"armv7-rtems-eabihf",
3839
"riscv32e-unknown-none-elf",

src/bootstrap/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl Build {
665665
}
666666
// Generate memcpy, etc. FIXME: Remove this once compiler-builtins
667667
// automatically detects this target.
668-
if target.contains("zkvm") {
668+
if target.contains("zkvm") || target.contains("vex") {
669669
features.insert("compiler-builtins-mem");
670670
}
671671

0 commit comments

Comments
 (0)