Skip to content

Commit

Permalink
Update to Emscripten 3.1.64 (#589)
Browse files Browse the repository at this point in the history
* Update to Emscripten 3.1.52

3.1.52 no longer allows using .bc, so use .o instead. Using .a throws
"Unknown format, not a static library!".

* Upgrade to Emscripten 3.1.64

v3.1.55 removed the --memory-init-file option, and this caused the build
to fail with "emcc: error: --memory-init-file is no longer supported".

Fixed by removing the option from Makefile.
  • Loading branch information
cxcorp authored Jul 29, 2024
1 parent d58d741 commit 1eb07a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 $@
Expand Down

0 comments on commit 1eb07a3

Please sign in to comment.