Repository: sql-js/sql.js (language: javascript)

Issue:
Emscripten 3.1.52 incompatible with build
Hello,

I just wanted to give a heads-up that it seems that emscripten `3.1.51` is the latest version with which `sql.js` builds.

Version [3.1.52](https://github.com/emscripten-core/emscripten/blob/8c81cac1bbae378bc7dde0c21c99602cbaf452d0/ChangeLog.md#3152---011924) added this change:

> emcc will now treat .bc files as source files. These means that will get compiled by clang before being passed to the linker. This matches the behaviour of clang. (emscripten-core/emscripten#20922)

When building with 3.1.52, the build fails with `out/sqlite3.bc:1:2: error: expected top-level entity` (the somewhat garbled output seems to be due to `-j8`):

```
625.2 emcc --memory-init-file 0 -s RESERVED_FUNCTION_POINTERS=64 -s ALLOW_TABLE_GROWTH=1 -s EXPORTED_FUNCTIONS=@src/exported_functions.json -s EXPORTED_RUNTIME_METHODS=@src/exported_runtime_methods.json -s SINGLE_FILE=0 -s NODEJS_CATCH_EXIT=0 -s NODEJS_CATCH_REJECTION=0 -s STACK_SIZE=5MB -s ASSERTIONS=2 -O1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 out/sqlite3.bc out/extension-functions.bc --pre-js src/api.js -o dist/sql-wasm-debug.js
625.3 out/sqlite3.bcout/sqlite3.bcout/sqlite3.bc:::111:::222:::   error: error: error: expected top-level entityexpected top-level entityexpected top-level entity
625.3 
625.3 
625.3             111 |  |  | <U+0000><U+0000><U+0000>aaasssmmm<U+0001><U+0001><U+0001><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0000><U+0001><U+0001><U+0001><B6><B6><B6><84><84><84><80><80><80><80><80><80><U+0000><U+0000><U+0000>FFF```<U+0004><U+0004><U+0004><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>```<U+0001><U+0001><U+0001><U+007F><U+007F><U+007F><U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>```<U+0003><U+0003><U+0003><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>```<U+0005><U+0005><U+0005><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>```<U+0002><U+0002><U+0002><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>```<U+0001><U+0001><U+0001><U+007F><U+007F><U+007F><U+0000><U+0000><U+0000>``<U+0002>`<U+0002><U+007F><U+0002><U+007F><U+007F><U+007F><U+007F><U+007F><U+0000><U+0000><U+0000>```<U+0001><U+0001><U+0001><U+007F><U+007F><U+007F><U+0001><U+0001><U+0001>~~~```<U+0003><U+0003><U+0003><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0000><U+007F><U+0000>`<U+0000>`<U+0000>`<U+0000><U+0001><U+0000><U+0001><U+007F><U+0001><U+007F><U+007F>```<U+0000><U+0000><U+0000><U+0000><U+0000><U+0000>```<U+0003><U+0003><U+0003><U+007F><U+007F><U+007F><U+007F><U+007F>~<U+007F>~<U+0001>~<U+0001><U+0001><U+007F><U+007F><U+007F>```<U+0001><U+0001><U+0001>~~~<U+0001><U+0001><U+0001>~~~```<U+0000><U+0000><U+0000><U+0001><U+0001><U+0001>~~~```<U+0001><U+0001><U+0001>~~~<U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>```<U+0002><U+0002><U+007F><U+0002><U+007F>~<U+007F>~<U+0001>~<U+0001><U+007F><U+0001><U+007F>`<U+007F>`<U+0001>`<U+0001><U+0001><U+007F><U+007F><U+007F><U+0001><U+0001><U+0001>||`|`<U+0002>`<U+0002><U+007F><U+0002><U+007F>|<U+007F>|<U+0000>|<U+0000><U+0000>```<U+0004><U+0004><U+0004>~~~~~~~~~~~~<U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>``<U+0005>`<U+0005><U+007F><U+0005><U+007F>~<U+007F>~~~~~~~~~<U+0000>~`<U+0000>~<U+0002>`<U+0000>`~<U+0002><U+0002>~~~~<U+0001>~~<U+0001><U+0001>`~~<U+0003>``<U+0003><U+007F><U+0003><U+007F>|<U+007F>|||<U+0000>||`<U+0000><U+0002><U+0000>`<U+007F>`<U+0002><U+007F><U+0002><U+007F><U+0001><U+007F><U+007F>~<U+007F><U+0001>`out/sqlite3.bc<U+0001>~<U+0007>:~`<U+007F>1`<U+0007><U+007F>:<U+0007>2<U+007F><U+007F><U+007F>:<U+007F><U+007F><U+007F><U+007F> <U+007F><U+007F><U+007F>error: <U+007F><U+007F>expected top-level entity<U+007F><U+007F><U+007F>
625.3 <U+007F><U+007F><U+007F><U+0001><U+0001><U+007F><U+007F><U+007F><U+0001>``<U+007F><U+0002><U+0002>`<U+007F><U+007F><U+0002>~~<U+007F><U+0000><U+0000>~``<U+0000><U+0005><U+0005>`<U+007F><U+007F><U+0005><U+007F><U+007F><U+007F>~~<U+007F><U+007F><U+007F><U+007F>~<U+007F><U+0001><U+007F><U+007F><U+0001><U+007F>`<U+007F><U+0001><U+0006>`<U+007F><U+007F><U+0006>`<U+007F><U+007F><U+0006><U+007F><U+007F><U+007F>~<U+007F><U+007F>~~<U+007F><U+007F>~~<U+0001><U+007F>~<U+007F><U+007F><U+0001>`<U+0001><U+007F><U+0004><U+007F>`<U+007F>`<U+0004><U+007F><U+0004><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0000><U+007F><U+007F>`<U+007F><U+007F><U+0004>    <U+0000><U+0000><U+007F>1``<U+007F> | <U+0004><U+0004><U+0000><U+007F><U+007F><U+007F>a<U+007F>s~<U+007F><U+007F>m<U+0001><U+007F>~<U+0001><U+007F>~<U+0001><U+0000>`<U+007F><U+0001><U+0000><U+0003>`<U+0000><U+0003><U+007F><U+007F><U+0001><U+007F>`~<B6>~<U+0003><U+007F><84><U+007F><U+007F><U+0001><80><U+0001>~<U+007F><80><U+007F><U+007F>`<U+0000>`<U+0001><U+0003>F<U+0003><U+007F><U+007F>`<U+007F><U+0004><U+007F>`<U+007F><U+007F>~<U+0003>~<U+007F><U+0000><U+007F>`<U+0000><U+007F><U+007F>`<U+0005><U+007F>~<U+0005><U+007F><U+007F><U+0001><U+0000><U+007F><U+007F><U+007F>`<U+007F><U+007F><U+0005>`<U+007F><U+007F><U+007F><U+0001><U+007F><U+007F><U+007F><U+007F><U+0000><U+0000><U+007F>`<U+0001>`<U+007F><U+0004><U+007F><U+007F><U+0004><U+007F>`<U+0000><U+007F><U+007F><U+0003>`<U+007F>~<U+007F><U+0004>~<U+007F><U+007F><U+007F><U+007F><U+0000><U+007F><U+007F><U+0000>`<U+0001>~`<U+007F><U+0005><U+007F><U+0000><U+0005><U+007F>``<U+007F><U+007F><U+0005><U+0005><U+007F>~<U+007F><U+007F>~<U+007F><U+007F><U+007F><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F><U+0000><U+007F><U+007F><U+0000>`<U+0001><U+0000>`<U+0002><U+007F>`<U+0002><U+007F>`<U+0002><U+007F><U+0002><U+007F><U+007F><U+007F><U+0001><U+007F><U+0001><U+007F>|<U+0001>|<U+007F>`|``<U+0006><U+0001><U+0006><U+0006><U+007F><U+007F><U+007F><U+007F><U+007F>`<U+007F><U+007F><U+007F><U+0001><U+007F><U+007F>~<U+007F>~~<U+007F><U+0000><U+007F><U+007F><U+007F>`<U+007F><U+007F><U+0001><U+0002><U+007F><U+0001><U+0001><U+007F>`<U+007F><U+007F>`<U+007F><U+0005>`<U+0005><U+0000><U+007F>`<U+0005><U+007F><U+0001><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001>~~<U+007F>~<U+007F>`<U+007F>~<U+0001><U+0003><U+0001><U+007F><U+007F><U+0001>`<U+007F><U+007F><U+007F><U+0003><U+007F>``<U+0003><U+0003><U+007F><U+007F><U+007F><U+007F><U+007F><U+0000><U+007F>`|<U+007F>|<U+0000><U+0001>|<U+0001><U+0001><U+0001><U+007F><U+007F><U+007F>``<U+007F>`<U+0002>|<U+0002>`<U+0000>|~<U+0002><U+0000>|~<U+0001>`~<U+0001><U+007F><U+0003><U+0001><U+007F><U+007F><U+007F>``<U+007F>`<U+0007><U+0007>~<U+0007><U+007F><U+007F><U+0001><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F>`<U+007F><U+0001><U+007F><U+007F>~~~~<U+007F><U+0001><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+0001><U+0001><U+007F>`<U+0001><U+007F>`<U+0000><U+007F>`<U+0006>`<U+0006><U+0001><U+007F><U+0006><U+007F>~<U+007F><U+007F><U+007F><U+007F>`<U+007F><U+007F><U+007F><U+0001><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F><U+0001><U+0001><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+0001><U+007F>``<U+007F>`<U+0008><U+0002>`<U+0008><U+0008><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F>`<U+007F><U+007F><U+007F><U+0001><U+007F><U+007F><U+007F><U+0001><U+0001><U+007F><U+0001><U+007F>|<U+007F><U+007F>``<U+0001>`<U+000B><U+0002><U+007F><U+000B><U+007F><U+007F>`<U+007F><U+007F>|<U+007F><U+000B><U+007F><U+0000><U+007F><U+007F><U+007F>`<U+007F><U+007F><U+007F><U+007F><U+0004><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F><U+0001><U+0001><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>``<U+007F><U+007F><U+0005>`       <U+007F><U+007F>       <U+007F>~<U+0001><U+007F><U+007F>~<U+007F><U+007F><U+007F>~`<U+007F><U+007F>~<U+007F>       <U+007F><U+0000><U+007F><U+007F><U+007F>`<U+007F><U+007F><U+0002><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+007F><U+0001><U+0001>~<U+007F><U+0001><U+007F>``<U+007F><U+007F><U+0003>
625.3 `<U+007F><U+007F><U+0001>      
625.3 ||       |<U+007F>        ^| <U+0000>`
625.3         ^`
625.3 
625.3 <U+0002>      <U+007F>| <U+007F>        ^<U+0001>
625.3 ~`<U+0007><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+0002><U+007F>~<U+0000>`<U+0005><U+007F><U+007F>~<U+007F><U+007F><U+0001><U+007F>`<U+0006><U+007F><U+007F><U+007F>~~<U+007F><U+0001><U+007F>`<U+0004><U+007F><U+007F><U+007F><U+007F><U+0000>`<U+0004><U+007F><U+007F><U+007F>~<U+0001><U+007F>`<U+0003>1<U+007F> error1~ generated error1.
625.3 <U+007F> generated error<U+0001>.
625.3 <U+007F> generated`.
625.3 <U+0003><U+007F><U+007F>~<U+0000>`<U+0005><U+007F><U+007F><U+007F><U+007F><U+007F><U+0000>`<U+0004><U+007F><U+007F>~<U+007F><U+0000>`<U+0005><U+007F><U+007F>~<U+007F><U+007F><U+0000>`<U+0002><U+007F><U+007F><U+0001>|`<U+0006><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+0001><U+007F>`<U+0005><U+007F><U+007F><U+007F>~<U+007F><U+0001><U+007F>`<U+0003><U+007F><U+007F>|<U+0001><U+007F>`<U+0002>|~<U+0001><U+007F>`<U+0007><U+007F><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+0001><U+007F>`<U+0006><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+0008><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+000B><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`       <U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`
625.3       |         ^
625.3 1 error generated.
625.3 out/sqlite3.bc:1:2: error: expected top-level entity
625.3     1 | <U+0000>asm<U+0001><U+0000><U+0000><U+0000><U+0001><B6><84><80><80><U+0000>F`<U+0004><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+0001><U+007F><U+0001><U+007F>`<U+0003><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+0005><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+0002><U+007F><U+007F><U+0001><U+007F>`<U+0001><U+007F><U+0000>`<U+0002><U+007F><U+007F><U+0000>`<U+0001><U+007F><U+0001>~`<U+0003><U+007F><U+007F><U+007F><U+0000>`<U+0000><U+0001><U+007F>`<U+0000><U+0000>`<U+0003><U+007F><U+007F>~<U+0001><U+007F>`<U+0001>~<U+0001>~`<U+0000><U+0001>~`<U+0001>~<U+0001><U+007F>`<U+0002><U+007F>~<U+0001><U+007F>`<U+0001><U+007F><U+0001>|`<U+0002><U+007F>|<U+0000>`<U+0004>~~~~<U+0001><U+007F>`<U+0005><U+007F>~~~~<U+0000>`<U+0002>~~<U+0001>~`<U+0003><U+007F>||<U+0000>`<U+0002><U+007F><U+007F><U+0001>~`<U+0007><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+0002><U+007F>~<U+0000>`<U+0005><U+007F><U+007F>~<U+007F><U+007F><U+0001><U+007F>`<U+0006><U+007F><U+007F><U+007F>~~<U+007F><U+0001><U+007F>`<U+0004><U+007F><U+007F><U+007F><U+007F><U+0000>`<U+0004><U+007F><U+007F><U+007F>~<U+0001><U+007F>`<U+0003><U+007F>~<U+007F><U+0001><U+007F>`<U+0003><U+007F><U+007F>~<U+0000>`<U+0005><U+007F><U+007F><U+007F><U+007F><U+007F><U+0000>`<U+0004><U+007F><U+007F>~<U+007F><U+0000>`<U+0005><U+007F><U+007F>~<U+007F><U+007F><U+0000>`<U+0002><U+007F><U+007F><U+0001>|`<U+0006><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+0001><U+007F>`<U+0005><U+007F><U+007F><U+007F>~<U+007F><U+0001><U+007F>`<U+0003><U+007F><U+007F>|<U+0001><U+007F>`<U+0002>|~<U+0001><U+007F>`<U+0007><U+007F><U+007F><U+007F><U+007F>~<U+007F><U+007F><U+0001><U+007F>`<U+0006><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+0008><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`<U+000B><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`       <U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+007F><U+0001><U+007F>`
625.3       |         ^
625.3 1 error generated.
625.3 emcc: error: '/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default --sysroot=/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -Oz -flto out/sqlite3.bc -c -o /tmp/emscripten_temp_h78hqigr/sqlite3_0.o' failed (returned 1)
625.3 emcc: error: '/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -O1 out/sqlite3.bc -c -o /tmp/emscripten_temp_onl_5iyh/sqlite3_0.o' failed (returned 1)
625.3 emcc: error: '/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default --sysroot=/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -Oz -flto out/sqlite3.bc -c -o /tmp/emscripten_temp_sv8_kc3g/sqlite3_0.o' failed (returned 1)
625.3 emcc: error: '/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default --sysroot=/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -Oz -flto out/sqlite3.bc -c -o /tmp/emscripten_temp_w2og3jh2/sqlite3_0.o' failed (returned 1)
625.3 emcc: error: '/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -O1 out/sqlite3.bc -c -o /tmp/emscripten_temp_us0o7k47/sqlite3_0.o' failed (returned 1)
625.3 make: *** [Makefile:107: dist/sql-asm-memory-growth.js] Error 1
625.3 make: *** Waiting for unfinished jobs....
625.3 make: *** [Makefile:80: dist/sql-asm-debug.js] Error 1
625.3 make: *** [Makefile:86: dist/sql-wasm-debug.js] Error 1
625.3 make: *** [Makefile:101: dist/sql-wasm.js] Error 1
625.3 make: *** [Makefile:95: dist/sql-asm.js] Error 1
```

Another project's tracking issue for this (libretro/RetroArch#16160) suggests renaming the `.bc` to `.a` in the makefile, but I am not knowledgeable enough to suggest a solution.

Building with 3.1.51 produces warnings which I think may be related to this:

> emcc: warning: .bc output file suffix used without -flto or -emit-llvm.  Consider using .o extension since emcc will output an object file, not a bitcode file [-Wemcc]

Here is a `Dockerfile` to reproduce this:

```dockerfile
FROM emscripten/emsdk:3.1.52
# this works:
#FROM emscripten/emsdk:3.1.51

WORKDIR /src

RUN apt-get update && apt-get install -y libdigest-sha3-perl

# pull sources
RUN wget https://github.com/sql-js/sql.js/archive/d58d741189660f64555a603fbebfe4fae6a121bd.zip \
  && unzip d58d741189660f64555a603fbebfe4fae6a121bd.zip

# build sql.js
RUN cd /src/sql.js-d58d741189660f64555a603fbebfe4fae6a121bd \
  && npm i \
  && MAKEFLAGS="-j8" npm run build
```


Discussion / hints:
Thanks for raising this !

Can you open a pr where you rename the .bc to .a in https://github.com/sql-js/sql.js/blob/master/Makefile and update emscripten in https://github.com/sql-js/sql.js/blob/master/.devcontainer/Dockerfile#L27 ?

Fix patch:
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 309697e0..24204861 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -24,7 +24,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
 # Install EMSDK to /emsdk just like the EMSDK Dockerfile: https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
 ENV EMSDK /emsdk
 # We pin the EMSDK version rather than 'latest' so that everyone is using the same compiler version
-ENV EMSCRIPTEN_VERSION 3.1.51
+ENV EMSCRIPTEN_VERSION 3.1.64
 
 RUN git clone https://github.com/emscripten-core/emsdk.git $EMSDK
 
diff --git a/Makefile b/Makefile
index b8aebf6d..dc9e4872 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,6 @@ SQLITE_COMPILATION_FLAGS = \
 # Since tihs is a library and not a standalone executable, we don't want to catch unhandled Node process exceptions
 # So, we do : `NODEJS_CATCH_EXIT=0`, which fixes issue: https://github.com/sql-js/sql.js/issues/173 and https://github.com/sql-js/sql.js/issues/262
 EMFLAGS = \
-	--memory-init-file 0 \
 	-s RESERVED_FUNCTION_POINTERS=64 \
 	-s ALLOW_TABLE_GROWTH=1 \
 	-s EXPORTED_FUNCTIONS=@src/exported_functions.json \
@@ -60,7 +59,7 @@ EMFLAGS_DEBUG = \
 	-s ASSERTIONS=2 \
 	-O1
 
-BITCODE_FILES = out/sqlite3.bc out/extension-functions.bc
+BITCODE_FILES = out/sqlite3.o out/extension-functions.o
 
 OUTPUT_WRAPPER_FILES = src/shell-pre.js src/shell-post.js
 
@@ -143,13 +142,13 @@ dist/worker.sql-wasm-debug.js: dist/sql-wasm-debug.js src/worker.js
 # 	#mv out/sql-wasm-debug.wasm dist/sql-wasm-debug.wasm
 # 	rm out/tmp-raw.js
 
-out/sqlite3.bc: sqlite-src/$(SQLITE_AMALGAMATION)
+out/sqlite3.o: sqlite-src/$(SQLITE_AMALGAMATION)
 	mkdir -p out
 	# Generate llvm bitcode
 	$(EMCC) $(SQLITE_COMPILATION_FLAGS) -c sqlite-src/$(SQLITE_AMALGAMATION)/sqlite3.c -o $@
 
 # Since the extension-functions.c includes other headers in the sqlite_amalgamation, we declare that this depends on more than just extension-functions.c
-out/extension-functions.bc: sqlite-src/$(SQLITE_AMALGAMATION)
+out/extension-functions.o: sqlite-src/$(SQLITE_AMALGAMATION)
 	mkdir -p out
 	# Generate llvm bitcode
 	$(EMCC) $(SQLITE_COMPILATION_FLAGS) -c sqlite-src/$(SQLITE_AMALGAMATION)/extension-functions.c -o $@


Test patch: