Skip to content

Commit 4aea656

Browse files
authored
bpo-32033: Finalize WASI configure options (GH-32053)
1 parent 9b889b5 commit 4aea656

File tree

4 files changed

+64
-4
lines changed

4 files changed

+64
-4
lines changed

Tools/wasm/config.site-wasm32-wasi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# config.site override for cross compiling to wasm32-wasi platform
22
#
33
# Written by Christian Heimes <christian@python.org>
4-
# Partly based on pyodide's pyconfig.undefs.h file.
5-
64

75
# cannot be detected in cross builds
86
ac_cv_buggy_getaddrinfo=no
@@ -14,4 +12,8 @@ ac_cv_file__dev_ptc=no
1412
# dummy readelf, WASI build does not need readelf.
1513
ac_cv_prog_ac_ct_READELF=true
1614

15+
# get/setrlimit are not supported
16+
ac_cv_header_sys_resource_h=no
17+
18+
# undefined symbols / unsupported features
1719
ac_cv_func_eventfd=no

configure

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

configure.ac

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,9 @@ AS_CASE([$ac_sys_system/$ac_sys_emscripten_target],
18981898
],
18991899
[WASI/*], [
19001900
AC_DEFINE([_WASI_EMULATED_SIGNAL], [1], [Define to 1 if you want to emulate signals on WASI])
1901-
LIBS="$LIBS -lwasi-emulated-signal"
1901+
AC_DEFINE([_WASI_EMULATED_GETPID], [1], [Define to 1 if you want to emulate getpid() on WASI])
1902+
AC_DEFINE([_WASI_EMULATED_PROCESS_CLOCKS], [1], [Define to 1 if you want to emulate process clocks on WASI])
1903+
LIBS="$LIBS -lwasi-emulated-signal -lwasi-emulated-getpid -lwasi-emulated-process-clocks"
19021904
echo "#define _WASI_EMULATED_SIGNAL 1" >> confdefs.h
19031905
]
19041906
)
@@ -6078,6 +6080,7 @@ AC_ARG_WITH(ensurepip,
60786080
[
60796081
AS_CASE([$ac_sys_system],
60806082
[Emscripten], [with_ensurepip=no],
6083+
[WASI], [with_ensurepip=no],
60816084
[with_ensurepip=upgrade]
60826085
)
60836086
])
@@ -6468,6 +6471,25 @@ AS_CASE([$ac_sys_system/$ac_sys_emscripten_target],
64686471
[syslog],
64696472
)
64706473
],
6474+
[WASI/*], [
6475+
PY_STDLIB_MOD_SET_NA(
6476+
[_ctypes],
6477+
[_ctypes_test],
6478+
[_curses],
6479+
[_curses_panel],
6480+
[_dbm],
6481+
[_gdbm],
6482+
[_scproxy],
6483+
[_tkinter],
6484+
[_xxsubinterpreters],
6485+
[grp],
6486+
[nis],
6487+
[ossaudiodev],
6488+
[pwd],
6489+
[spwd],
6490+
[syslog],
6491+
)
6492+
],
64716493
[PY_STDLIB_MOD_SET_NA([_scproxy])]
64726494
)
64736495

pyconfig.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,12 @@
17281728
/* Define to force use of thread-safe errno, h_errno, and other functions */
17291729
#undef _REENTRANT
17301730

1731+
/* Define to 1 if you want to emulate getpid() on WASI */
1732+
#undef _WASI_EMULATED_GETPID
1733+
1734+
/* Define to 1 if you want to emulate process clocks on WASI */
1735+
#undef _WASI_EMULATED_PROCESS_CLOCKS
1736+
17311737
/* Define to 1 if you want to emulate signals on WASI */
17321738
#undef _WASI_EMULATED_SIGNAL
17331739

0 commit comments

Comments
 (0)