Commit c7dc2d5
authored
Disallow loading code on
* Disallow loading code on `x86_64-unknown-none`
... And then also add an escape hatch to allow loading code. This commit
is the culmination of discussion on #11506 with a proposed resolution
for Wasmtime. The resolution being:
* Wasmtime will reject loading code on `x86_64-unknown-none` platforms
by default.
* A new `Config::x86_float_abi_ok` escape hatch is added to bypass this
check.
* Documentation/errors are updated around `x86_float_abi_ok` to
document the situation.
* The `min-platform` example is updated to showcase how this is valid to
run in that particular embedding (aka enable more features and
sufficiently detect said features).
The basic tl;dr; is that we can't detect in stable Rust what float ABI
is being used so therefore we pessimistically assume that
`x86_64-unknown-none` is using a soft-float ABI. This is incompatible
with libcalls unless they aren't actually called which is only possible
when sufficiently many target features are enabled.
The goal of this commit is to be a relatively low-effort way to place a
roadblock in the way of "ok ABIs are weird" but at the same time enable
getting around the roadblock easily. Additionally the roadblock points
to documentation about itself to learn more about what's going on here.
Closes #11506
* Add audit of raw-cpuid
* Add back in check
Turns out it doesn't go through the same path as other bits
* Review comments
* Fix running floats without without custom supportx86_64-unknown-none (#11553)1 parent 4c39cb9 commit c7dc2d5
File tree
8 files changed
+229
-26
lines changed- crates/wasmtime/src
- examples/min-platform
- embedding
- src
- src
- supply-chain
8 files changed
+229
-26
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| 275 | + | |
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
| |||
2701 | 2703 | | |
2702 | 2704 | | |
2703 | 2705 | | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
2704 | 2776 | | |
2705 | 2777 | | |
2706 | 2778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
144 | | - | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
| |||
293 | 291 | | |
294 | 292 | | |
295 | 293 | | |
296 | | - | |
297 | 294 | | |
298 | 295 | | |
299 | 296 | | |
| |||
302 | 299 | | |
303 | 300 | | |
304 | 301 | | |
305 | | - | |
306 | 302 | | |
307 | 303 | | |
308 | 304 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | 305 | | |
| 306 | + | |
| 307 | + | |
313 | 308 | | |
314 | 309 | | |
315 | 310 | | |
316 | | - | |
| 311 | + | |
317 | 312 | | |
318 | 313 | | |
319 | 314 | | |
| |||
337 | 332 | | |
338 | 333 | | |
339 | 334 | | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
346 | 345 | | |
347 | 346 | | |
348 | 347 | | |
| |||
356 | 355 | | |
357 | 356 | | |
358 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
359 | 374 | | |
360 | 375 | | |
361 | 376 | | |
| |||
601 | 616 | | |
602 | 617 | | |
603 | 618 | | |
604 | | - | |
605 | | - | |
| 619 | + | |
| 620 | + | |
606 | 621 | | |
607 | 622 | | |
608 | 623 | | |
| |||
876 | 891 | | |
877 | 892 | | |
878 | 893 | | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
879 | 897 | | |
880 | 898 | | |
881 | 899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
62 | 108 | | |
63 | | - | |
| 109 | + | |
64 | 110 | | |
65 | 111 | | |
66 | 112 | | |
| |||
70 | 116 | | |
71 | 117 | | |
72 | 118 | | |
73 | | - | |
| 119 | + | |
74 | 120 | | |
75 | 121 | | |
76 | 122 | | |
77 | 123 | | |
78 | 124 | | |
79 | 125 | | |
80 | 126 | | |
81 | | - | |
| 127 | + | |
82 | 128 | | |
83 | 129 | | |
84 | 130 | | |
85 | 131 | | |
86 | | - | |
| 132 | + | |
87 | 133 | | |
88 | 134 | | |
89 | 135 | | |
| |||
93 | 139 | | |
94 | 140 | | |
95 | 141 | | |
96 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
97 | 156 | | |
98 | 157 | | |
99 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
0 commit comments