Skip to content

Rename bundled SQLite symbols in HHVM OSS Rust FFI staticlib - #9872

Open
mszabo-wikia wants to merge 1 commit into
meta:masterfrom
mszabo-wikia:sqlite-transitive
Open

mszabo-wikia wants to merge 1 commit into
meta:masterfrom
mszabo-wikia:sqlite-transitive

Conversation

@mszabo-wikia

Copy link
Copy Markdown
Contributor

rusqlite is built with its "bundled" feature, which statically links a private SQLite copy (currently 3.53.2) into libhhvm_ffi_bridge.a. When linked into hhvm, those definitions took precedence over the system libsqlite3 that ext_sqlite3 and ext_pdo_sqlite are configured against, so both extensions silently ran on rusqlite's SQLite. This then caused unexpected sqlite3 behavior changes during updates.

After cargo builds the staticlib, prefix every global sqlite3* symbol (definitions and references alike) with hackc_ via objcopy --redefine-syms. The Rust side keeps its bundled SQLite and the autocargo-generated Cargo.toml files stay untouched.

rusqlite is built with its "bundled" feature, which statically links a
private SQLite copy (currently 3.53.2) into libhhvm_ffi_bridge.a. When
linked into hhvm, those definitions took precedence over the system
libsqlite3 that ext_sqlite3 and ext_pdo_sqlite are configured against,
so both extensions silently ran on rusqlite's SQLite.
This then caused unexpected sqlite3 behavior changes during updates.

After cargo builds the staticlib, prefix every global sqlite3* symbol
(definitions and references alike) with hackc_ via
objcopy --redefine-syms. The Rust side keeps its bundled SQLite and the
autocargo-generated Cargo.toml files stay untouched.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@meta-cla meta-cla Bot added the CLA Signed label Oct 13, 2026
@meta-codesync

meta-codesync Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D124984919. (Because this pull request was imported automatically, there will not be any future comments.)

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

1 participant