]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-84461: Build Emscripten with WASM BigInt support (#94219)
authorChristian Heimes <christian@python.org>
Fri, 24 Jun 2022 15:03:42 +0000 (17:03 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Jun 2022 15:03:42 +0000 (17:03 +0200)
Tools/wasm/README.md
configure
configure.ac

index 94b3729a5daadb216b4a17d116e6a564ec644adb..40f23a396f6711c630275cd92755239ad074d350 100644 (file)
@@ -98,9 +98,11 @@ popd
 ```
 
 ```shell
-node --experimental-wasm-threads --experimental-wasm-bulk-memory builddir/emscripten-node/python.js
+node --experimental-wasm-threads --experimental-wasm-bulk-memory --experimental-wasm-bigint builddir/emscripten-node/python.js
 ```
 
+(``--experimental-wasm-bigint`` is not needed with recent NodeJS versions)
+
 # wasm32-emscripten limitations and issues
 
 Emscripten before 3.1.8 has known bugs that can cause memory corruption and
index 34de0f7f1b66c5f3991a90bcf868ddab3a13d0eb..9f15e492b997c2ce0932a03b71cddf2c3230af7f 100755 (executable)
--- a/configure
+++ b/configure
@@ -7953,6 +7953,8 @@ fi
 
         as_fn_append LDFLAGS_NODIST " -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=20971520"
 
+        as_fn_append LDFLAGS_NODIST " -sWASM_BIGINT"
+
         as_fn_append LDFLAGS_NODIST " -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworkerfs.js"
 
     if test "x$enable_wasm_dynamic_linking" = xyes; then :
index 3b70532e4d0e1ac7fafc1c84ffba7a3a51cf279b..f9abd851ea5cbf84fa9e66bbc781ff7f4db27d00 100644 (file)
@@ -2028,6 +2028,9 @@ AS_CASE([$ac_sys_system],
     dnl Start with 20 MB and allow to grow
     AS_VAR_APPEND([LDFLAGS_NODIST], [" -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=20971520"])
 
+    dnl map int64_t and uint64_t to JS bigint
+    AS_VAR_APPEND([LDFLAGS_NODIST], [" -sWASM_BIGINT"])
+
     dnl Include file system support
     AS_VAR_APPEND([LDFLAGS_NODIST], [" -sFORCE_FILESYSTEM -lidbfs.js -lnodefs.js -lproxyfs.js -lworkerfs.js"])