|
1 | | -diff --git a/Programs/python.c b/Programs/python.c |
2 | | -index 84148f7..348207e 100644 |
3 | | ---- a/Programs/python.c |
4 | | -+++ b/Programs/python.c |
5 | | -@@ -2,16 +2,72 @@ |
6 | | - |
7 | | - #include "Python.h" |
8 | | - |
9 | | --#ifdef MS_WINDOWS |
10 | | --int |
11 | | --wmain(int argc, wchar_t **argv) |
12 | | -+#if __PYDK__ |
13 | | -+#include "pycore_call.h" // _PyObject_CallNoArgs() |
14 | | -+#include "pycore_initconfig.h" // _PyArgv |
15 | | -+#include "pycore_interp.h" // _PyInterpreterState.sysdict |
16 | | -+#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0() |
17 | | -+#include "pycore_pylifecycle.h" // _Py_PreInitializeFromPyArgv() |
18 | | -+#include "pycore_pystate.h" // _PyInterpreterState_GET() |
19 | | -+ |
20 | | -+static PyStatus |
21 | | -+pymain_init(const _PyArgv *args) |
22 | | -+{ |
23 | | -+ PyStatus status; |
24 | | -+ |
25 | | -+ status = _PyRuntime_Initialize(); |
26 | | -+ if (_PyStatus_EXCEPTION(status)) { |
27 | | -+ return status; |
28 | | -+ } |
29 | | -+ |
30 | | -+ PyPreConfig preconfig; |
31 | | -+ PyPreConfig_InitPythonConfig(&preconfig); |
32 | | -+ |
33 | | -+ status = _Py_PreInitializeFromPyArgv(&preconfig, args); |
34 | | -+ if (_PyStatus_EXCEPTION(status)) { |
35 | | -+ return status; |
36 | | -+ } |
37 | | -+ |
38 | | -+ PyConfig config; |
39 | | -+ PyConfig_InitPythonConfig(&config); |
40 | | -+ |
41 | | -+ if (args->use_bytes_argv) { |
42 | | -+ status = PyConfig_SetBytesArgv(&config, args->argc, args->bytes_argv); |
43 | | -+ } |
44 | | -+ else { |
45 | | -+ status = PyConfig_SetArgv(&config, args->argc, args->wchar_argv); |
46 | | -+ } |
47 | | -+ if (_PyStatus_EXCEPTION(status)) { |
48 | | -+ goto done; |
49 | | -+ } |
50 | | -+ |
51 | | -+ status = Py_InitializeFromConfig(&config); |
52 | | -+ if (_PyStatus_EXCEPTION(status)) { |
53 | | -+ goto done; |
54 | | -+ } |
55 | | -+ status = _PyStatus_OK(); |
56 | | -+ |
57 | | -+done: |
58 | | -+ PyConfig_Clear(&config); |
59 | | -+ return status; |
60 | | -+} |
61 | | -+ |
62 | | -+static void |
63 | | -+pymain_free(void) |
64 | | - { |
65 | | -- return Py_Main(argc, argv); |
66 | | -+ _PyImport_Fini2(); |
67 | | -+ _PyPathConfig_ClearGlobal(); |
68 | | -+ _Py_ClearStandardStreamEncoding(); |
69 | | -+ _Py_ClearArgcArgv(); |
70 | | -+ _PyRuntime_Finalize(); |
| 1 | +diff --git a/Python/sysmodule.c b/Python/sysmodule.c |
| 2 | +index c2de4ec..0bae03c 100644 |
| 3 | +--- a/Python/sysmodule.c |
| 4 | ++++ b/Python/sysmodule.c |
| 5 | +@@ -55,7 +55,7 @@ extern void *PyWin_DLLhModule; |
| 6 | + extern const char *PyWin_DLLVersionString; |
| 7 | + #endif |
| 8 | + |
| 9 | +-#ifdef __EMSCRIPTEN__ |
| 10 | ++#if 0 |
| 11 | + # include <emscripten.h> |
| 12 | + #endif |
| 13 | + |
| 14 | +@@ -3222,7 +3222,7 @@ make_impl_info(PyObject *version_info) |
| 15 | + return NULL; |
71 | 16 | } |
72 | | -+ |
73 | | -+#include "/opt/python-wasm-sdk/support/__EMSCRIPTEN__.c" |
74 | | - #else |
75 | | - int |
76 | | - main(int argc, char **argv) |
77 | | - { |
78 | | -+ |
79 | | - return Py_BytesMain(argc, argv); |
80 | | - } |
81 | | --#endif |
82 | | -+#endif //#if __PYDK__ |
83 | | -diff --git a/configure b/configure |
84 | | -index 0e5f3f6..5cf6451 100755 |
85 | | ---- a/configure |
86 | | -+++ b/configure |
87 | | -@@ -9179,7 +9179,7 @@ fi |
88 | | - |
89 | | - as_fn_append LDFLAGS_NODIST " -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=20971520" |
90 | | - |
91 | | -- as_fn_append LDFLAGS_NODIST " -sWASM_BIGINT" |
92 | | -+ as_fn_append LDFLAGS_NODIST " " |
93 | | - |
94 | | - as_fn_append LDFLAGS_NODIST " -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworkerfs.js" |
95 | | - |
96 | | -diff --git a/configure.ac b/configure.ac |
97 | | -index 4938681..ecad731 100644 |
98 | | ---- a/configure.ac |
99 | | -+++ b/configure.ac |
100 | | -@@ -2103,7 +2103,7 @@ AS_CASE([$ac_sys_system], |
101 | | - AS_VAR_APPEND([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=20971520"]) |
102 | | - |
103 | | - dnl map int64_t and uint64_t to JS bigint |
104 | | -- AS_VAR_APPEND([LDFLAGS_NODIST], [" -sWASM_BIGINT"]) |
105 | | -+ AS_VAR_APPEND([LDFLAGS_NODIST], [" "]) |
106 | 17 |
|
107 | | - dnl Include file system support |
108 | | - AS_VAR_APPEND([LDFLAGS_NODIST], [" -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworkerfs.js"]) |
| 18 | +-#ifdef __EMSCRIPTEN__ |
| 19 | ++#if 0 |
| 20 | + |
| 21 | + PyDoc_STRVAR(emscripten_info__doc__, |
| 22 | + "sys._emscripten_info\n\ |
| 23 | +@@ -3454,7 +3454,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict) |
| 24 | + goto type_init_failed; |
| 25 | + } |
| 26 | + |
| 27 | +-#ifdef __EMSCRIPTEN__ |
| 28 | ++#if 0 |
| 29 | + if (EmscriptenInfoType == NULL) { |
| 30 | + EmscriptenInfoType = PyStructSequence_NewType(&emscripten_info_desc); |
| 31 | + if (EmscriptenInfoType == NULL) { |
| 32 | +@@ -3734,7 +3734,7 @@ _PySys_FiniTypes(PyInterpreterState *interp) |
| 33 | + #endif |
| 34 | + _PyStructSequence_FiniBuiltin(interp, &Hash_InfoType); |
| 35 | + _PyStructSequence_FiniBuiltin(interp, &AsyncGenHooksType); |
| 36 | +-#ifdef __EMSCRIPTEN__ |
| 37 | ++#if 0 |
| 38 | + if (_Py_IsMainInterpreter(interp)) { |
| 39 | + Py_CLEAR(EmscriptenInfoType); |
| 40 | + } |
0 commit comments