Repository navigation
Commit 3e8e729
authored
rust: preserve WASIp3 TLS for no-std task context (#1745)
* rust: preserve WASIp3 TLS for no-std task context
The prebuilt task-context helper was compiled with -mcpu=mvp, which
lowers its _Thread_local storage to a plain global. Overlapping async
exports on WASIp3 then share the same task state and panic in start_task.
Keep wasip3_task_set in the MVP archive used by every wasm32 target.
Move the versioned context accessors into a separate archive compiled
for wasm32-wasip3 and link it only for that target. Regenerate the C,
object, and archive files and check the TLS-base import during rebuilds.
Validation:
- Stock nightly-2026-10-12 and Wasmtime 47.0.2: the unpatched HTTP
handler returns 20/20 concurrent 500s; the fix returns 20/20 200s.
- Rust 1.99.0 builds binaries and cdylibs for WASIp1, WASIp2, and
wasm32-unknown-unknown without introducing TLS-base imports.
- WASIp1/WASIp2 binaries and the unknown-target probe run successfully;
native unit tests and the generated doctest pass.
- SDK 34 and wasm-tools 1.258.0 regenerate artifacts identically on
macOS arm64. Reintroducing the MVP flag makes the rebuild guard fail.
- cargo fmt --all --check and git diff --check pass.
* rust: link the WASIp3 TLS helper only without std1 parent 1145d46 commit 3e8e729
8 files changed
Lines changed: 46 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
| |||
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
117 | | - | |
118 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
122 | | - | |
123 | | - | |
| 133 | + | |
| 134 | + | |
124 | 135 | | |
125 | 136 | | |
126 | | - | |
127 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
128 | 147 | | |
129 | 148 | | |
130 | 149 | | |
131 | 150 | | |
132 | 151 | | |
| 152 | + | |
| 153 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Binary file not shown.
0 commit comments