From: stephan Date: Tue, 23 Aug 2022 17:02:46 +0000 (+0000) Subject: Wasm build flag tweaks and documentation. X-Git-Tag: version-3.40.0~169^2~163 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c45a9f952bed5b3d459bd04005b8afabc9c52a2;p=thirdparty%2Fsqlite.git Wasm build flag tweaks and documentation. FossilOrigin-Name: c8eb3aa8e0f487f14791214caf70d1aa03866e01345c7fa1d5607c24c39dde1d --- diff --git a/Makefile.in b/Makefile.in index 56ab4c88a1..31cb05f4cc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1543,15 +1543,20 @@ $(sqlite3_wasm_c): sqlite3.c #emcc_opt = -O3 emcc_opt = -Oz emcc_environment = web -# WASMFS OPFS is currently completely broken under fiddle but the -# root cause has not yet been determined. -emcc_flags_opfs = -#emcc_flags_opfs += -sWASMFS -pthread +# WASMFS/OPFS currently (2022-08-23) does not work with fiddle +# because (A) fiddle is primarily implemented as a Worker and (B) the +# Emscripten-based Worker loading process does not properly handle the +# case of nested Workers (necessary for it to load the WASMFS-specific +# Worker thread). +emcc_flags_wasmfs = +# To enable WASMFS/OPFS, uncomment these options: +#emcc_flags_wasmfs += -sWASMFS -pthread #emcc_environment = web,worker -#emcc_flags_opfs += -DSQLITE_WASM_OPFS -#emcc_flags_opfs += '-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' -#emcc_flags_opfs += -sPTHREAD_POOL_SIZE=2 -#emcc_flags_opfs += -sPTHREAD_POOL_SIZE_STRICT=2 +#emcc_flags_wasmfs += -DSQLITE_WASM_OPFS +#emcc_flags_wasmfs += -sPTHREAD_POOL_SIZE=2 +#emcc_flags_wasmfs += -sPTHREAD_POOL_SIZE_STRICT=2 +# (Thread pool settings may require tweaking.) +#/end of WASMFS/OPFS options. emcc_flags = $(emcc_opt) \ -sALLOW_TABLE_GROWTH \ -sABORTING_MALLOC \ @@ -1563,10 +1568,12 @@ emcc_flags = $(emcc_opt) \ --minify 0 \ -I. $(SHELL_OPT) \ -DSQLITE_THREADSAFE=0 \ + -DSQLITE_TEMP_STORE=3 \ -DSQLITE_OMIT_UTF16 \ -DSQLITE_OMIT_DEPRECATED \ -DSQLITE_OMIT_SHARED_CACHE \ - $(emcc_flags_opfs) + '-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' \ + $(emcc_flags_wasmfs) $(fiddle_module_js): Makefile $(sqlite3_wasm_c) shell.c \ $(wasm_dir)/EXPORTED_RUNTIME_METHODS.fiddle \ $(wasm_dir)/EXPORTED_FUNCTIONS.fiddle diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 467034f9e8..db96a42ffc 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -18,6 +18,7 @@ else endif fiddle: $(MAKE) -C ../.. fiddle -e emcc_opt=$(fiddle_opt) +all: fiddle clean: $(MAKE) -C ../../ clean-fiddle @@ -46,8 +47,12 @@ SQLITE_OPT = \ -DSQLITE_OMIT_DEPRECATED \ -DSQLITE_OMIT_UTF16 \ -DSQLITE_OMIT_SHARED_CACHE \ - -DSQLITE_THREADSAFE=0 + -DSQLITE_THREADSAFE=0 \ + -DSQLITE_TEMP_STORE=3 #SQLITE_OPT += -DSQLITE_ENABLE_MEMSYS5 +# ^^^ MEMSYS5 is hypothetically useful for non-Emscripten builds but +# requires adding more infrastructure and fixing one spot in the +# sqlite3 internals which calls malloc() early on. $(dir.top)/sqlite3.c: $(MAKE) -C $(dir.top) sqlite3.c diff --git a/manifest b/manifest index b297210960..ef10d9657a 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C More\sexperimentation\swith\show\sclient-side\sconfig\sstate\scan\sbe\spassed\son\sto\sinitialize\sthe\sJS-side\ssqlite3\sAPI. -D 2022-08-22T21:37:17.339 +C Wasm\sbuild\sflag\stweaks\sand\sdocumentation. +D 2022-08-23T17:02:46.959 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 7d19258e83981c69dcdc63c46dfa83de907fc1c1c0472a6dc0d31b2fae376764 +F Makefile.in 544e93e4a996b7a1cd98ce8c2381cc487068a516e84243a6251fc3ba9638fe6c F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241 F Makefile.msc d547a2fdba38a1c6cd1954977d0b0cc017f5f8fbfbc65287bf8d335808938016 F README.md 8b8df9ca852aeac4864eb1e400002633ee6db84065bd01b78c33817f97d31f5e @@ -474,7 +474,7 @@ F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04 F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle db7a4602f043cf4a5e4135be3609a487f9f1c83f05778bfbdf93766be4541b96 F ext/wasm/EXPORTED_RUNTIME_METHODS.fiddle a004bd5eeeda6d3b28d16779b7f1a80305bfe009dfc7f0721b042967f0d39d02 -F ext/wasm/GNUmakefile 19c21ce4df5583278cc495bffbe03c69dc64af60fa9dac01766d0192bd191ac6 +F ext/wasm/GNUmakefile 79f0ddba6b6b474fad46a927aa9cd0fdbeb372c5332c84e8096d6b490df0f9db F ext/wasm/README.md e1ee1e7c321c6a250bf78a84ca6f5882890a237a450ba5a0649c7a8399194c52 F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 77ef4bcf37e362b9ad61f9c175dfc0f1b3e571563fb311b96581cf422ee6a8ec F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287 @@ -2006,8 +2006,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P e215d55a97e1ccbca3101621374444d2381d87ef8e8fde5271e31c8b714e43e9 -R 46e3280ce6b3dabfd5a5df8623d5cf20 +P ea2acc454c012a62556f6d0623d6eff60736d24aa214a64462b423623ef44d47 +R 72b1967923c17320161370eaaa7aa1c3 U stephan -Z e9aff16acc00367edea41a90ce619433 +Z 64cee0eefa2cd9236a38fc28a7dddd9f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index bb6efe14bd..5d826619c0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ea2acc454c012a62556f6d0623d6eff60736d24aa214a64462b423623ef44d47 \ No newline at end of file +c8eb3aa8e0f487f14791214caf70d1aa03866e01345c7fa1d5607c24c39dde1d \ No newline at end of file