1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Document why the wasm build does not use Emscripten's -sSTRICT=1 flag and account for a behaviour change in emsdk 3.1.55 regarding the HEAPxyz symbols.

FossilOrigin-Name: f6e887203365b30cea6e9c145366345e48256a347388577edf2bada65e0655b7
This commit is contained in:
stephan
2024-03-04 09:56:47 +00:00
parent bae55a7685
commit 2775f10ebc
4 changed files with 27 additions and 10 deletions

View File

@ -531,6 +531,10 @@ emcc.jsflags += -sSTRICT_JS=0
# 3.1.31. The fix for that in newer emcc's is to throw a built-time # 3.1.31. The fix for that in newer emcc's is to throw a built-time
# error if STRICT_JS is used together with those options. # error if STRICT_JS is used together with those options.
# emcc.jsflags += -sSTRICT=1
# -sSTRICT=1 Causes failures about unknown symbols which the build
# tools should be installing, e.g. __syscall_geteuid32
# -sENVIRONMENT values for the various build modes: # -sENVIRONMENT values for the various build modes:
emcc.environment.vanilla := web,worker emcc.environment.vanilla := web,worker
emcc.environment.bundler-friendly := $(emcc.environment.vanilla) emcc.environment.bundler-friendly := $(emcc.environment.vanilla)
@ -551,6 +555,11 @@ emcc.environment.node := node
# time with 16mb+ memory and 3X time when starting with 8MB. However, # time with 16mb+ memory and 3X time when starting with 8MB. However,
# such test results are inconsistent due to browser internals which # such test results are inconsistent due to browser internals which
# are opaque to us. # are opaque to us.
#
# 2024-03-04: emsdk 3.1.55 replaces INITIAL_MEMORY with INITIAL_HEAP,
# but also says (in its changelog): "Note that it is currently not
# supported in all configurations (#21071)."
# https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md
emcc.jsflags += -sALLOW_MEMORY_GROWTH emcc.jsflags += -sALLOW_MEMORY_GROWTH
emcc.INITIAL_MEMORY.128 := 134217728 emcc.INITIAL_MEMORY.128 := 134217728
emcc.INITIAL_MEMORY.96 := 100663296 emcc.INITIAL_MEMORY.96 := 100663296

View File

@ -137,8 +137,16 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
bigIntEnabled: (()=>{ bigIntEnabled: (()=>{
if('undefined'!==typeof Module){ if('undefined'!==typeof Module){
/* Emscripten module will contain HEAPU64 when built with /* Emscripten module will contain HEAPU64 when built with
-sWASM_BIGINT=1, else it will not. */ -sWASM_BIGINT=1, else it will not.
return !!Module.HEAPU64;
As of emsdk 3.1.55, when building in strict mode, HEAPxyz
are only available if _explicitly_ included in the exports,
else they are not. We do not (as of 2024-03-04) use -sSTRICT
for the canonical builds.
*/
if( !!Module.HEAPU64 ) return true;
/* Else fall through and hope for the best. Nobody _really_
builds this without BigInt support, do they? */
} }
return !!globalThis.BigInt64Array; return !!globalThis.BigInt64Array;
})(), })(),

View File

@ -1,5 +1,5 @@
C When\swarning\sabout\smultiple\sinvocations\sof\sJS's\ssqlite3ApiBootstrap(),\suse\sthe\swarning\slogger\sinstalled\sby\sthe\sfirst\sinvocation,\srather\sthan\sconsole.warn. C Document\swhy\sthe\swasm\sbuild\sdoes\snot\suse\sEmscripten's\s-sSTRICT=1\sflag\sand\saccount\sfor\sa\sbehaviour\schange\sin\semsdk\s3.1.55\sregarding\sthe\sHEAPxyz\ssymbols.
D 2024-03-04T09:23:52.944 D 2024-03-04T09:56:47.061
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -587,7 +587,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
F ext/wasm/GNUmakefile 316349101671037a30311fbb40bd0b8702d9a223b5205a6a5eae8bac7b8dc1a0 F ext/wasm/GNUmakefile 92e929315c3f1e0ea389fc9666b87a67a61fa1ecbe37e44c5ad226bda3bc6abe
F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576
F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
@ -607,7 +607,7 @@ F ext/wasm/api/pre-js.c-pp.js ad906703f7429590f2fbf5e6498513bf727a1a4f0ebfa057af
F ext/wasm/api/sqlite3-api-cleanup.js d235ad237df6954145404305040991c72ef8b1881715d2a650dda7b3c2576d0e F ext/wasm/api/sqlite3-api-cleanup.js d235ad237df6954145404305040991c72ef8b1881715d2a650dda7b3c2576d0e
F ext/wasm/api/sqlite3-api-glue.js 587dc6db2d69329a5f4cb9635c377f516cf4a8e30f443f33380e5044889ec71b F ext/wasm/api/sqlite3-api-glue.js 587dc6db2d69329a5f4cb9635c377f516cf4a8e30f443f33380e5044889ec71b
F ext/wasm/api/sqlite3-api-oo1.js 7f3bcf0549ac44cde4b9da0b642d771916738d3f6781fb8a1757c50a91e506c0 F ext/wasm/api/sqlite3-api-oo1.js 7f3bcf0549ac44cde4b9da0b642d771916738d3f6781fb8a1757c50a91e506c0
F ext/wasm/api/sqlite3-api-prologue.js 5000fea107dcd2754c1d9c9080a8d534ad7e299bb6f8ad6dd97c08740fde2dca F ext/wasm/api/sqlite3-api-prologue.js 93a72b07b2a5d964d2edc76a90b439ece49298bd7ba60a1c6ae5d4878213701e
F ext/wasm/api/sqlite3-api-worker1.js 8d9c0562831f62218170a3373468d8a0b7a6503b5985e309b69bf71187b525cf F ext/wasm/api/sqlite3-api-worker1.js 8d9c0562831f62218170a3373468d8a0b7a6503b5985e309b69bf71187b525cf
F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89 F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
F ext/wasm/api/sqlite3-opfs-async-proxy.js 8cf8a897726f14071fae6be6648125162b256dfb4f96555b865dbb7a6b65e379 F ext/wasm/api/sqlite3-opfs-async-proxy.js 8cf8a897726f14071fae6be6648125162b256dfb4f96555b865dbb7a6b65e379
@ -2176,8 +2176,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P e6b14f73136aae4c1a92d6d6ab8c5d1510db5244d0b0f168eed5b4b257c99064 P d162af2d9941cd8c53e3928efb42aaaf4e59454f7d39aebf980a30b1427ea75b
R 386793253f6df9a64972715ed54c745e R a1392e5e8b70ba68a9cec5956be8638d
U stephan U stephan
Z 0abd34f742b690ed7162270a587892b4 Z eecd3ea1a1eec87bef8ed5be6afc5f59
# Remove this line to create a well-formed Fossil manifest. # Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
d162af2d9941cd8c53e3928efb42aaaf4e59454f7d39aebf980a30b1427ea75b f6e887203365b30cea6e9c145366345e48256a347388577edf2bada65e0655b7