Skip to content

Commit fc53be1

Browse files
authored
Merge pull request #798 from alexcrichton/wasip3
Update WASIp3 WITs to 0.3.0
2 parents 04bd527 + 063c380 commit fc53be1

18 files changed

Lines changed: 525 additions & 503 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ else()
145145
endif()
146146

147147
set(wasip2-version 0.2.0)
148-
set(wasip3-version 0.3.0-rc-2026-03-15)
148+
set(wasip3-version 0.3.0)
149149

150150
include(bindings)
151151
include(builtins)

expected/wasm32-wasip3/defined-symbols.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ erfl
559559
errno
560560
exit
561561
exit_exit
562+
exit_exit_with_code
562563
exit_result_void_void_free
563564
exp
564565
exp10

expected/wasm32-wasip3/undefined-symbols.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ __wasm_import_environment_get_arguments
5454
__wasm_import_environment_get_environment
5555
__wasm_import_environment_get_initial_cwd
5656
__wasm_import_exit_exit
57+
__wasm_import_exit_exit_with_code
5758
__wasm_import_filesystem_descriptor_drop
5859
__wasm_import_filesystem_method_descriptor_advise
5960
__wasm_import_filesystem_method_descriptor_append_via_stream

libc-bottom-half/cloudlibc/src/libc/poll/poll.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ static int poll_impl(struct pollfd *fds, size_t nfds, int timeout) {
493493

494494
out:
495495
if (timeout_subtask != 0) {
496+
wasip3_waitable_join(timeout_subtask, 0);
496497
wasip3_subtask_cancel(timeout_subtask);
497498
wasip3_subtask_drop(timeout_subtask);
498499
}

libc-bottom-half/cloudlibc/src/libc/stdlib/_Exit.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
noreturn void _Exit(int status) {
1111
#if defined(__wasip1__)
1212
__wasi_proc_exit(status);
13-
#elif defined(__wasip2__) || defined(__wasip3__)
13+
#elif defined(__wasip2__)
14+
exit_result_void_void_t exit_status = { .is_err = status != 0 };
15+
exit_exit(&exit_status);
16+
#elif defined(__wasip3__)
17+
if (status >= 0 && status <= 255)
18+
exit_exit_with_code(status);
1419
exit_result_void_void_t exit_status = { .is_err = status != 0 };
1520
exit_exit(&exit_status);
1621
#else

libc-bottom-half/crt/crt1-command.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ __attribute__((export_name("_start"))) void _start(void)
1818
// that this shouldn't be too problematic (in theory).
1919
__attribute__((export_name("wasi:cli/run@0.2.0#run"))) int _start(void)
2020
#elif defined(__wasip3__)
21-
__attribute__((export_name("wasi:cli/run@0.3.0-rc-2026-03-15#run"))) int
22-
_start(void)
21+
__attribute__((export_name("wasi:cli/run@0.3.0#run"))) int _start(void)
2322
#else
2423
#error "Unsupported WASI version"
2524
#endif

libc-bottom-half/headers/public/wasi/__generated_wasip3.h

Lines changed: 26 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)