[Python-checkins] gh-84461: Build Emscripten with WASM BigInt support (GH-94219)

miss-islington webhook-mailer at python.org
Fri Jun 24 11:30:51 EDT 2022


https://github.com/python/cpython/commit/c966e0816ed1efffcf91a415629409be16eb8af9
commit: c966e0816ed1efffcf91a415629409be16eb8af9
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-06-24T08:30:46-07:00
summary:

gh-84461: Build Emscripten with WASM BigInt support (GH-94219)

(cherry picked from commit e69306f08b9be84ccdd0a1c6601ec229c4e5b377)

Co-authored-by: Christian Heimes <christian at python.org>

files:
M Tools/wasm/README.md
M configure
M configure.ac

diff --git a/Tools/wasm/README.md b/Tools/wasm/README.md
index 94b3729a5daad..40f23a396f671 100644
--- a/Tools/wasm/README.md
+++ b/Tools/wasm/README.md
@@ -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
diff --git a/configure b/configure
index be5de5720852c..d1827ad691443 100755
--- 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 :
diff --git a/configure.ac b/configure.ac
index a8b2326d79177..cbeb8b9e921ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"])
 



More information about the Python-checkins mailing list