Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Emscripten 3.1.52 incompatible with build #588

Copy link
Copy link
Closed
@cxcorp

Description

@cxcorp
Issue body actions

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 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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.