Skip to content

Commit 6d53256

Browse files
lewisfmtropicaaal
authored andcommitted
wip: port some old std work
1 parent fd75a9c commit 6d53256

File tree

15 files changed

+947
-0
lines changed

15 files changed

+947
-0
lines changed

library/Cargo.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ dependencies = [
329329
"unwind",
330330
"wasi 0.11.1+wasi-snapshot-preview1",
331331
"wasi 0.14.3+wasi-0.2.4",
332+
"vex-sdk",
332333
"windows-targets 0.0.0",
333334
]
334335

@@ -390,6 +391,13 @@ dependencies = [
390391
"rustc-std-workspace-core",
391392
]
392393

394+
[[package]]
395+
name = "vex-sdk"
396+
version = "0.27.0"
397+
dependencies = [
398+
"rustc-std-workspace-core",
399+
]
400+
393401
[[package]]
394402
name = "wasi"
395403
version = "0.11.1+wasi-snapshot-preview1"

library/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ rustflags = ["-Cpanic=abort"]
5959
rustc-std-workspace-core = { path = 'rustc-std-workspace-core' }
6060
rustc-std-workspace-alloc = { path = 'rustc-std-workspace-alloc' }
6161
rustc-std-workspace-std = { path = 'rustc-std-workspace-std' }
62+
63+
vex-sdk = { path = "../../vex-sdk/packages/vex-sdk" }

library/std/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ wasip2 = { version = '0.14.3', features = [
8989
r-efi = { version = "5.2.0", features = ['rustc-dep-of-std'] }
9090
r-efi-alloc = { version = "2.0.0", features = ['rustc-dep-of-std'] }
9191

92+
[target.'cfg(target_os = "vexos")'.dependencies]
93+
vex-sdk = { version = "0.27.0", features = [
94+
'rustc-dep-of-std',
95+
], default-features = false }
96+
9297
[features]
9398
backtrace = [
9499
'addr2line/rustc-dep-of-std',

library/std/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fn main() {
5252
|| target_os == "rtems"
5353
|| target_os == "nuttx"
5454
|| target_os == "cygwin"
55+
|| target_os == "vexos"
5556

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

library/std/src/env.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,7 @@ pub mod consts {
10981098
/// * `"redox"`
10991099
/// * `"solaris"`
11001100
/// * `"solid_asp3`
1101+
/// * `"vexos"`
11011102
/// * `"vita"`
11021103
/// * `"vxworks"`
11031104
/// * `"xous"`
@@ -1148,6 +1149,7 @@ pub mod consts {
11481149
///
11491150
/// <details><summary>Full list of possible values</summary>
11501151
///
1152+
/// * `"bin"`
11511153
/// * `"exe"`
11521154
/// * `"efi"`
11531155
/// * `"js"`

library/std/src/sys/env_consts.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,17 @@ pub mod os {
323323
pub const EXE_EXTENSION: &str = "efi";
324324
}
325325

326+
#[cfg(target_os = "vexos")]
327+
pub mod os {
328+
pub const FAMILY: &str = "";
329+
pub const OS: &str = "vexos";
330+
pub const DLL_PREFIX: &str = "";
331+
pub const DLL_SUFFIX: &str = "";
332+
pub const DLL_EXTENSION: &str = "";
333+
pub const EXE_SUFFIX: &str = ".bin";
334+
pub const EXE_EXTENSION: &str = "bin";
335+
}
336+
326337
#[cfg(target_os = "visionos")]
327338
pub mod os {
328339
pub const FAMILY: &str = "unix";

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ cfg_select! {
4545
mod trusty;
4646
pub use self::trusty::*;
4747
}
48+
target_os = "vexos" => {
49+
mod vexos;
50+
pub use self::vexos::*;
51+
}
4852
all(target_os = "wasi", target_env = "p2") => {
4953
mod wasip2;
5054
pub use self::wasip2::*;

0 commit comments

Comments
 (0)