Skip to content

Commit 082ee46

Browse files
authored
Pass --generate-threading-helpers for WASIP3 bindings and bump wit-bindgen (#744)
In preparation for pthreads PRs
1 parent 6636cc7 commit 082ee46

9 files changed

Lines changed: 151 additions & 7 deletions

File tree

cmake/bindings.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if(WIT_BINDGEN_EXECUTABLE)
1515
OUTPUT_VARIABLE WIT_BINDGEN_VERSION
1616
OUTPUT_STRIP_TRAILING_WHITESPACE)
1717

18-
if (NOT (WIT_BINDGEN_VERSION MATCHES "0\\.51\\.0"))
19-
message(WARNING "wit-bindgen version 0.51.0 is required, found: ${WIT_BINDGEN_VERSION}")
18+
if (NOT (WIT_BINDGEN_VERSION MATCHES "0\\.53\\.1"))
19+
message(WARNING "wit-bindgen version 0.53.1 is required, found: ${WIT_BINDGEN_VERSION}")
2020
set(WIT_BINDGEN_EXECUTABLE "")
2121
endif()
2222
endif()
@@ -26,7 +26,7 @@ if (NOT WIT_BINDGEN_EXECUTABLE)
2626
ba_download(
2727
wit-bindgen
2828
"https://github.com/bytecodealliance/wit-bindgen"
29-
"0.51.0"
29+
"0.53.1"
3030
)
3131
ExternalProject_Get_Property(wit-bindgen SOURCE_DIR)
3232
set(wit_bindgen "${SOURCE_DIR}/wit-bindgen")
@@ -87,6 +87,7 @@ add_custom_target(
8787
--rename-world wasip3
8888
--type-section-suffix __wasi_libc
8989
--world wasi:cli/imports@${wasip3-version}
90+
--generate-threading-helpers
9091
--rename wasi:clocks/monotonic-clock@${wasip3-version}=monotonic_clock
9192
--rename wasi:clocks/system-clock@${wasip3-version}=system_clock
9293
--rename wasi:filesystem/preopens@${wasip3-version}=filesystem_preopens

expected/wasm32-wasip3/defined-symbols.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,9 @@ vwscanf
14661466
wasip3_backpressure_dec
14671467
wasip3_backpressure_inc
14681468
wasip3_context_get_0
1469+
wasip3_context_get_1
14691470
wasip3_context_set_0
1471+
wasip3_context_set_1
14701472
wasip3_list_string_free
14711473
wasip3_list_tuple2_string_string_free
14721474
wasip3_list_u8_free
@@ -1479,7 +1481,19 @@ wasip3_subtask_block_on
14791481
wasip3_subtask_cancel
14801482
wasip3_subtask_drop
14811483
wasip3_task_cancel
1484+
wasip3_thread_index
1485+
wasip3_thread_new_indirect
1486+
wasip3_thread_suspend
1487+
wasip3_thread_suspend_cancellable
1488+
wasip3_thread_suspend_to
1489+
wasip3_thread_suspend_to_cancellable
1490+
wasip3_thread_suspend_to_suspended
1491+
wasip3_thread_suspend_to_suspended_cancellable
1492+
wasip3_thread_unsuspend
14821493
wasip3_thread_yield
1494+
wasip3_thread_yield_cancellable
1495+
wasip3_thread_yield_to_suspended
1496+
wasip3_thread_yield_to_suspended_cancellable
14831497
wasip3_tuple2_string_string_free
14841498
wasip3_waitable_block_on
14851499
wasip3_waitable_join

expected/wasm32-wasip3/undefined-symbols.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ __addtf3
22
__backpressure_dec
33
__backpressure_inc
44
__context_get_0
5+
__context_get_1
56
__context_set_0
7+
__context_set_1
68
__data_end
79
__divtf3
810
__eqtf2
@@ -26,7 +28,19 @@ __subtask_cancel
2628
__subtask_drop
2729
__subtf3
2830
__task_cancel
31+
__thread_index
32+
__thread_new_indirect
33+
__thread_suspend
34+
__thread_suspend_cancellable
35+
__thread_suspend_to
36+
__thread_suspend_to_cancellable
37+
__thread_suspend_to_suspended
38+
__thread_suspend_to_suspended_cancellable
39+
__thread_unsuspend
2940
__thread_yield
41+
__thread_yield_cancellable
42+
__thread_yield_to_suspended
43+
__thread_yield_to_suspended_cancellable
3044
__trunctfdf2
3145
__trunctfsf2
3246
__unordtf2

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

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

libc-bottom-half/sources/wasip2.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 Bytes
Binary file not shown.

libc-bottom-half/sources/wasip3.c

Lines changed: 100 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)