1
+ diff --git a/Cargo.toml b/Cargo.toml
2
+ index 5dd315ef2f7..680fb821c4c 100644
3
+ --- a/Cargo.toml
4
+ +++ b/Cargo.toml
5
+ @@ -120,6 +120,7 @@ strip = true
6
+ rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
7
+ rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
8
+ rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
9
+ + compiler_builtins = { git = "https://github.com/rust-lang/compiler-builtins", rev = "0.1.105" }
10
+
11
+ [patch."https://github.com/rust-lang/rust-clippy"]
12
+ clippy_lints = { path = "src/tools/clippy/clippy_lints" }
1
13
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
2
14
index 941d767b..1b4004c4 100644
3
15
--- a/compiler/rustc_target/src/spec/mod.rs
@@ -10,6 +22,21 @@ index 941d767b..1b4004c4 100644
10
22
("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
11
23
("riscv32im-risc0-zkvm-elf", riscv32im_risc0_zkvm_elf),
12
24
("riscv32im-unknown-none-elf", riscv32im_unknown_none_elf),
25
+ diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
26
+ index 5ed6b357e20..a31645ab6e7 100644
27
+ --- a/src/bootstrap/src/lib.rs
28
+ +++ b/src/bootstrap/src/lib.rs
29
+ @@ -91,6 +91,10 @@
30
+ /* Extra values not defined in the built-in targets yet, but used in std */
31
+ (Some(Mode::Std), "target_env", Some(&["libnx", "p2"])),
32
+ // (Some(Mode::Std), "target_os", Some(&[])),
33
+ + // #[cfg(bootstrap)] zkvm
34
+ + (Some(Mode::Std), "target_os", Some(&["zkvm"])),
35
+ + // #[cfg(bootstrap)] athena
36
+ + (Some(Mode::Std), "target_vendor", Some(&["athena", "succinct"])),
37
+ (Some(Mode::Std), "target_arch", Some(&["arm64ec", "spirv", "nvptx", "xtensa"])),
38
+ /* Extra names used by dependencies */
39
+ // FIXME: Used by serde_json, but we should not be triggering on external dependencies.
13
40
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
14
41
index eab9138b..60507063 100644
15
42
--- a/src/tools/build-manifest/src/main.rs
@@ -18,7 +45,7 @@ index eab9138b..60507063 100644
18
45
"powerpc-unknown-linux-gnu",
19
46
"powerpc64-unknown-linux-gnu",
20
47
"powerpc64le-unknown-linux-gnu",
21
- + "riscv32e -athena-zkvm-elf",
48
+ + "riscv32em -athena-zkvm-elf",
22
49
"riscv32i-unknown-none-elf",
23
50
"riscv32im-risc0-zkvm-elf",
24
51
"riscv32im-unknown-none-elf",
@@ -72,3 +99,58 @@ index 00000000..a84f76c2
72
99
+ }
73
100
+ }
74
101
+
102
+ diff --git a/library/std/src/sys/pal/zkvm/args.rs b/library/std/src/sys/pal/zkvm/args.rs
103
+ index 7753cf63840..583c16e3a47 100644
104
+ --- a/library/std/src/sys/pal/zkvm/args.rs
105
+ +++ b/library/std/src/sys/pal/zkvm/args.rs
106
+ @@ -1,6 +1,7 @@
107
+ use super::{abi, WORD_SIZE};
108
+ use crate::ffi::OsString;
109
+ use crate::fmt;
110
+ + use crate::sys::os_str;
111
+ use crate::sys_common::FromInner;
112
+
113
+ pub struct Args {
114
+ @@ -33,7 +34,7 @@ fn argv(i: usize) -> OsString {
115
+ // "os_str".
116
+ let arg_bytes: &[u8] =
117
+ unsafe { crate::slice::from_raw_parts(words.cast() as *const u8, arg_len) };
118
+ - OsString::from_inner(super::os_str::Buf { inner: arg_bytes.to_vec() })
119
+ + OsString::from_inner(os_str::Buf { inner: arg_bytes.to_vec() })
120
+ }
121
+ }
122
+
123
+ diff --git a/library/std/src/sys/pal/zkvm/mod.rs b/library/std/src/sys/pal/zkvm/mod.rs
124
+ index 228a976dbab..c5a1843d5ff 100644
125
+ --- a/library/std/src/sys/pal/zkvm/mod.rs
126
+ +++ b/library/std/src/sys/pal/zkvm/mod.rs
127
+ @@ -12,8 +12,6 @@
128
+ pub mod alloc;
129
+ #[path = "../zkvm/args.rs"]
130
+ pub mod args;
131
+ - #[path = "../unix/cmath.rs"]
132
+ - pub mod cmath;
133
+ pub mod env;
134
+ #[path = "../unsupported/fs.rs"]
135
+ pub mod fs;
136
+ diff --git a/library/std/src/sys/pal/zkvm/os.rs b/library/std/src/sys/pal/zkvm/os.rs
137
+ index d8739ee3824..759beb2d306 100644
138
+ --- a/library/std/src/sys/pal/zkvm/os.rs
139
+ +++ b/library/std/src/sys/pal/zkvm/os.rs
140
+ @@ -5,6 +5,7 @@
141
+ use crate::io;
142
+ use crate::marker::PhantomData;
143
+ use crate::path::{self, PathBuf};
144
+ + use crate::sys::os_str;
145
+ use crate::sys_common::FromInner;
146
+
147
+ pub fn errno() -> i32 {
148
+ @@ -111,7 +112,7 @@ pub fn getenv(varname: &OsStr) -> Option<OsString> {
149
+ // reimplement "os_str" instead of just using the generic unix
150
+ // "os_str".
151
+ let u8s: &[u8] = unsafe { crate::slice::from_raw_parts(words.cast() as *const u8, nbytes) };
152
+ - Some(OsString::from_inner(super::os_str::Buf { inner: u8s.to_vec() }))
153
+ + Some(OsString::from_inner(os_str::Buf { inner: u8s.to_vec() }))
154
+ }
155
+
156
+ pub fn setenv(_: &OsStr, _: &OsStr) -> io::Result<()> {
0 commit comments