From c9c1b65698ed3fa83985c92e02dd872b56948f79 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 1 Oct 2024 17:08:23 +0000 Subject: [PATCH] Use the new SQLITE_USE_LONG_DOUBLE to disable long-double support in WASM builds, as they cannot be represented in JS and this saves approximately 5.5kb in the resulting wasm file. FossilOrigin-Name: fa7b56f776b715d061581fad6f04b871504ff5d808e7364419d1d6cdef82c5ee --- ext/wasm/GNUmakefile | 2 ++ ext/wasm/api/sqlite3-wasm.c | 6 ++++++ manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 2602e6b792..a68f813d6b 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -239,6 +239,7 @@ SQLITE_OPT.common := \ '-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' \ -DSQLITE_USE_URI=1 \ -DSQLITE_C=$(sqlite3.c) \ + -DSQLITE_USE_LONG_DOUBLE=0 \ -DSQLITE_OMIT_DEPRECATED \ -DSQLITE_OMIT_UTF16 \ -DSQLITE_OMIT_LOAD_EXTENSION \ @@ -251,6 +252,7 @@ SQLITE_OPT.common := \ # to be able to run without this: SQLITE_OPT.common += -DSQLITE_WASM_ENABLE_C_TESTS +# Extra flags for full-featured builds... SQLITE_OPT.full-featured := \ -DSQLITE_ENABLE_BYTECODE_VTAB \ -DSQLITE_ENABLE_DBPAGE_VTAB \ diff --git a/ext/wasm/api/sqlite3-wasm.c b/ext/wasm/api/sqlite3-wasm.c index 1c46b0ec05..945acd23dd 100644 --- a/ext/wasm/api/sqlite3-wasm.c +++ b/ext/wasm/api/sqlite3-wasm.c @@ -127,6 +127,10 @@ # define SQLITE_USE_URI 1 #endif +#ifndef SQLITE_USE_LONG_DOUBLE +# define SQLITE_USE_LONG_DOUBLE 0 +#endif + #ifdef SQLITE_WASM_EXTRA_INIT # define SQLITE_EXTRA_INIT sqlite3_wasm_extra_init #endif @@ -159,6 +163,8 @@ # define SQLITE_OMIT_PROGRESS_CALLBACK # undef SQLITE_OMIT_WAL # define SQLITE_OMIT_WAL +# undef SQLITE_USE_LONG_DOUBLE +# define SQLITE_USE_LONG_DOUBLE 0 /* The following OMITs do not work with the standard amalgamation, so require a custom build: diff --git a/manifest b/manifest index 38a8eea1a6..037e9a4724 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\scompile-time\soption\s-DSQLITE_USE_LONG_DOUBLE=0\sto\somit\sall\sattempts\sto\suse\n"long\sdouble".\s\sOr\s=1\sto\somit\sattempts\sto\suse\sthe\sDekker\salgorithms\sto\sachieve\nhigh-resolution\sfloating\spoint. -D 2024-10-01T16:55:30.223 +C Use\sthe\snew\sSQLITE_USE_LONG_DOUBLE\sto\sdisable\slong-double\ssupport\sin\sWASM\sbuilds,\sas\sthey\scannot\sbe\srepresented\sin\sJS\sand\sthis\ssaves\sapproximately\s5.5kb\sin\sthe\sresulting\swasm\sfile. +D 2024-10-01T17:08:23.912 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -603,7 +603,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3 F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c -F ext/wasm/GNUmakefile 6b94c3125c40932e71bbe46e582d24ed4c829b9fa2ff34dd842b0ed8a948ac6a +F ext/wasm/GNUmakefile c2ee5993e727dd2c1f0f784f47843fb7af45cebd23626b537bae2d2d8f4a3abd F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576 F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -632,7 +632,7 @@ F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js e529a99b7d5a088284821e2902b20d3404b561126969876997d5a73a656c9199 F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e99e3d99f736937914527070f00ab13e9391d3f1cef884ab99a64cbcbee8d675 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 -F ext/wasm/api/sqlite3-wasm.c e94665e6625c8b35113cf0eb7dec7acc2d9ed76eed78b3a1abf6cae5ad8097d3 +F ext/wasm/api/sqlite3-wasm.c 2ac6cff59668eed42a87b8b21ff66f0edf82b25c04bbb8adda0c4eff28ed11ce F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5 F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7 @@ -2213,8 +2213,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 0b83e8f1ef53b35a9dda0740b4922b8691428f7484f3058833a961f3f8d0b178 -R 1afae59e0efb08982f93adc40d14c2a9 -U drh -Z 56bb71650eaf744de022c729aea7d991 +P ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1 +R 7b5589656a320d55088e87a9d21d3695 +U stephan +Z b3281d7ec085a9e7d4c5e83e25b26b8b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 72b7e4100f..7113b4ff6a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1 +fa7b56f776b715d061581fad6f04b871504ff5d808e7364419d1d6cdef82c5ee