Skip to content

Commit c14c598

Browse files
lewisfmtropicaaal
authored andcommitted
wip: port some old std work
1 parent 35d55b3 commit c14c598

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
@@ -327,6 +327,7 @@ dependencies = [
327327
"rustc-demangle",
328328
"std_detect",
329329
"unwind",
330+
"vex-sdk",
330331
"wasi",
331332
"windows-targets 0.0.0",
332333
]
@@ -389,6 +390,13 @@ dependencies = [
389390
"rustc-std-workspace-core",
390391
]
391392

393+
[[package]]
394+
name = "vex-sdk"
395+
version = "0.27.0"
396+
dependencies = [
397+
"rustc-std-workspace-core",
398+
]
399+
392400
[[package]]
393401
name = "wasi"
394402
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
@@ -84,6 +84,11 @@ wasi = { version = "0.11.0", features = [
8484
r-efi = { version = "5.2.0", features = ['rustc-dep-of-std'] }
8585
r-efi-alloc = { version = "2.0.0", features = ['rustc-dep-of-std'] }
8686

87+
[target.'cfg(target_os = "vexos")'.dependencies]
88+
vex-sdk = { version = "0.27.0", features = [
89+
'rustc-dep-of-std',
90+
], default-features = false }
91+
8792
[features]
8893
backtrace = [
8994
'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)