[ANN] Firebird adds optional static fbclient libraries, including symbol-collision prevention

9 views
Skip to first unread message

Adrian Marius Popa

unread,
Aug 4, 2026, 4:15:21 AMAug 4
to firebird-general
Hi all,

Firebird's client library, libfbclient / fbclient.dll, has always been distributed only as a shared library. PR #9104 by Adriano dos Santos Fernandes, merged into the source tree on July 24, 2026, adds an optional, non-default static archive (libfbclient.a on POSIX, fbclient_static.lib on Windows) for applications that need to link the client library statically.

Why it wasn't offered before: Firebird overrides the global C++ operators (operator new/delete) to route bare allocations through its own memory pool. In the shared library this is hidden by the version script / .def file, so it never leaks into the host app. A static archive has no such boundary - the linker would silently resolve the host's own new/delete to Firebird's internal definitions, hijacking its memory allocation.

The fix: every internal symbol not part of the public API gets renamed with a __fbclient_ prefix as a post-processing step on the compiled archive (objcopy --redefine-syms on POSIX, llvm-objcopy on Windows), generated automatically from the export list - no hand-maintained lists. On Windows, this also required replacing the old DllMain-based thread cleanup with a new FLS-based ThreadCleanup class, since a statically linked build has no DLL module to hook DLL_THREAD_DETACH from.

25 files changed, +2168/-268, three commits. Full write-up with build commands and verification steps:


Regards,
Adrian
Reply all
Reply to author
Forward
0 new messages