Skip to content

Commit 119edb3

Browse files
authored
gh-154465: Add configure flag to exclude emscripten_syscalls.c (#154466)
Pyodide doesn't want to include emscripten_syscalls.c in the build since it links a different version of it. This adds a configure flag to drop it.
1 parent 13e3f8a commit 119edb3

2 files changed

Lines changed: 54 additions & 2 deletions

File tree

configure

Lines changed: 36 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: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,20 @@ AC_ARG_ENABLE([wasm-pthreads],
13651365
])
13661366
AC_MSG_RESULT([$enable_wasm_pthreads])
13671367

1368+
AC_MSG_CHECKING([for --enable-emscripten-syscalls])
1369+
AC_ARG_ENABLE([emscripten-syscalls],
1370+
[AS_HELP_STRING([--disable-emscripten-syscalls],
1371+
[Disable the Emscripten syscall overrides in Python/emscripten_syscalls.c (default is enabled for Emscripten)])],
1372+
[
1373+
AS_CASE([$ac_sys_system],
1374+
[Emscripten], [],
1375+
[AC_MSG_ERROR([--enable-emscripten-syscalls only applies to Emscripten])]
1376+
)
1377+
], [
1378+
enable_emscripten_syscalls=yes
1379+
])
1380+
AC_MSG_RESULT([$enable_emscripten_syscalls])
1381+
13681382
AC_MSG_CHECKING([for --with-suffix])
13691383
AC_ARG_WITH([suffix],
13701384
[AS_HELP_STRING([--with-suffix=SUFFIX], [set executable suffix to SUFFIX (default is empty, yes is mapped to '.exe')])],
@@ -5380,7 +5394,10 @@ PLATFORM_OBJS=
53805394

53815395
AS_CASE([$ac_sys_system],
53825396
[Emscripten], [
5383-
AS_VAR_APPEND([PLATFORM_OBJS], [' Python/emscripten_signal.o Python/emscripten_trampoline.o Python/emscripten_trampoline_wasm.o Python/emscripten_syscalls.o'])
5397+
AS_VAR_APPEND([PLATFORM_OBJS], [' Python/emscripten_signal.o Python/emscripten_trampoline.o Python/emscripten_trampoline_wasm.o'])
5398+
AS_VAR_IF([enable_emscripten_syscalls], [yes], [
5399+
AS_VAR_APPEND([PLATFORM_OBJS], [' Python/emscripten_syscalls.o'])
5400+
])
53845401
AS_VAR_APPEND([PLATFORM_HEADERS], [' $(srcdir)/Include/internal/pycore_emscripten_signal.h $(srcdir)/Include/internal/pycore_emscripten_trampoline.h'])
53855402
],
53865403
)

0 commit comments

Comments
 (0)