Skip to content

Skip the .fini_array finalizer on WebAssembly - #622

Closed
LucaCappelletti94 wants to merge 1 commit into
sqlcipher:prereleasefrom
LucaCappelletti94:upstream/wasm-fini-array
Closed

LucaCappelletti94 wants to merge 1 commit into
sqlcipher:prereleasefrom
LucaCappelletti94:upstream/wasm-fini-array

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

src/sqlcipher.c registers sqlcipher_fini in a .fini_array section on every target that is neither Windows nor Apple. LLVM cannot emit that section for WebAssembly and stops with .fini_array sections are unsupported, so no WebAssembly build of the amalgamation compiles without a source patch. This is one of the patches mentioned in rusqlite/rusqlite#1908.

The finalizer is skipped when __wasm__ is defined. The atexit() handler registered in sqlcipher_extra_init already runs the same shutdown on runtimes that exit, and other targets see unchanged source. The resulting build passes the sqlcipher-src interop suite in Node.

beta has the same lines and needs this too, but as I see it is stacked on prerelease it is likely something that can be cleanly rebased there.

@sjlombardo

Copy link
Copy Markdown
Member

Hi @LucaCappelletti94 - This has been merged internally and will be included in the next release. Thank you for the contribution!

@sjlombardo

Copy link
Copy Markdown
Member

@LucaCappelletti94 4.20.0 was just released and includes this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants