From: stephan Date: Wed, 1 Jun 2022 14:52:23 +0000 (+0000) Subject: Minor tweaks to, and consolidation of, the wasm-related build flags. X-Git-Tag: version-3.39.0~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23aa8ff4de91719647d799be469e7409825c6bc6;p=thirdparty%2Fsqlite.git Minor tweaks to, and consolidation of, the wasm-related build flags. FossilOrigin-Name: f0ad6b1b324f9c0f4340f6cf9584884d1206b56fe1010db43bcbef324e713ea3 --- diff --git a/Makefile.in b/Makefile.in index 94e37e76ac..a8d101b492 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1529,15 +1529,16 @@ sqlite3_wasm = $(fiddle_dir)/sqlite3.wasm #emcc_opt = -O2 #emcc_opt = -O3 emcc_opt = -Oz -emcc_flags = $(emcc_opt) -sALLOW_TABLE_GROWTH -I. $(SHELL_OPT) +emcc_flags = $(emcc_opt) -sALLOW_TABLE_GROWTH -sSTRICT_JS \ + -sENVIRONMENT=web -sMODULARIZE \ + -sEXPORTED_RUNTIME_METHODS=@$(fiddle_dir_abs)/EXPORTED_RUNTIME_METHODS \ + -sDYNAMIC_EXECUTION=0 \ + -I. $(SHELL_OPT) $(fiddle_module_js): Makefile sqlite3.c shell.c \ $(fiddle_dir)/EXPORTED_RUNTIME_METHODS \ $(fiddle_dir)/EXPORTED_FUNCTIONS.fiddle emcc -o $@ $(emcc_flags) \ - -sENVIRONMENT=web \ - -sMODULARIZE \ -sEXPORT_NAME=initFiddleModule \ - -sEXPORTED_RUNTIME_METHODS=@$(fiddle_dir_abs)/EXPORTED_RUNTIME_METHODS \ -sEXPORTED_FUNCTIONS=@$(fiddle_dir_abs)/EXPORTED_FUNCTIONS.fiddle \ sqlite3.c shell.c gzip < $@ > $@.gz @@ -1547,10 +1548,7 @@ $(sqlite3_wasm_js): Makefile sqlite3.c \ $(fiddle_dir)/EXPORTED_RUNTIME_METHODS \ $(fiddle_dir)/EXPORTED_FUNCTIONS.sqlite3-api emcc -o $@ $(emcc_flags) \ - -sENVIRONMENT=web \ - -sMODULARIZE \ -sEXPORT_NAME=initSqlite3Module \ - -sEXPORTED_RUNTIME_METHODS=@$(fiddle_dir_abs)/EXPORTED_RUNTIME_METHODS \ -sEXPORTED_FUNCTIONS=@$(fiddle_dir_abs)/EXPORTED_FUNCTIONS.sqlite3-api \ --post-js=$(fiddle_dir)/sqlite3-api.js \ --no-entry \ @@ -1580,7 +1578,10 @@ fiddle: $(fiddle_module_js) $(fiddle_dir)/fiddle.js.gz sqlite3-wasm: $(sqlite3_wasm_js) wasm: fiddle sqlite3-wasm ######################################################################## -# Explanation of the emcc build flags: +# Explanation of the emcc build flags follows. Full docs for these can +# be found at: +# +# https://github.com/emscripten-core/emscripten/blob/main/src/settings.js # # -sENVIRONMENT=web: elides bootstrap code related to non-web JS # environments like node.js. Removing this makes the output a tiny @@ -1604,6 +1605,23 @@ wasm: fiddle sqlite3-wasm # developers. e.g., _sqlite3_open_v2 and _sqlite3_finalize. Must be # an absolute path! # +# -sSTRICT_JS ensures that the emitted JS code includes the 'use +# strict' option. Note that -sSTRICT is more broadly-scoped and +# results in build errors. +# +# -sALLOW_TABLE_GROWTH is required for (at a minimum) the UDF-binding +# feature. +# +# -sDYNAMIC_EXECUTION=0 disables eval() and the Function constructor. +# If the build runs without these, it's preferable to use this flag +# because certain execution environments disallow those constructs. +# This flag is not strictly necessary, however. +# +# -sWASM_BIGINT is UNTESTED but "should" allow the int64-using C APIs +# to work with JS/wasm, insofar as the JS environment supports the +# BigInt type. That support requires an extremely recent browser: +# Safari didn't get that support until late 2020. +# # --no-entry: for compiling library code with no main(). If this is # not supplied and the code has a main(), it is called as part of the # module init process. Note that main() is #if'd out of shell.c diff --git a/manifest b/manifest index 0c125b9548..bceb19de1f 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Fix\sa\sminor\sproblem\sin\sthe\sTcl\s"incrblob"\scommand.\sThis\sdoes\snot\saffect\sthe\sSQLite\score. -D 2022-06-01T14:32:05.554 +C Minor\stweaks\sto,\sand\sconsolidation\sof,\sthe\swasm-related\sbuild\sflags. +D 2022-06-01T14:52:23.135 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in f876bff913171f8cd1ef0866b6c346bcae2caf00e219a48e1fa129701df41175 +F Makefile.in e45046a016985c8fedfc5e7aad88ee396033a1e9b4e929fd6e1033e4c39dba95 F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241 F Makefile.msc b28a8a7a977e7312f6859f560348e1eb110c21bd6cf9fab0d16537c0a514eef3 F README.md 8b8df9ca852aeac4864eb1e400002633ee6db84065bd01b78c33817f97d31f5e @@ -1974,8 +1974,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 382cd7e10b2df4216da8f25b55546bc74a963d9834af240f75ec8b8321ba106e -R ef79bb9e53693c3f781d762f53d114b4 -U dan -Z 499f9d1db46d766843c93e3c173e7b6f +P e96feccc21d9b858f076960e029b615809243d0cc3f95db75180feb01887451f +R 471b902d8001c2396cd771e4411b6c73 +U stephan +Z 12097a5aaa82e69db2d6ce001a3738eb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ce36c5c00e..aca23f850e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e96feccc21d9b858f076960e029b615809243d0cc3f95db75180feb01887451f \ No newline at end of file +f0ad6b1b324f9c0f4340f6cf9584884d1206b56fe1010db43bcbef324e713ea3 \ No newline at end of file