From d219d1445015a1b2c5d49e46a3626cad76f84335 Mon Sep 17 00:00:00 2001 From: Adam Harris Date: Mon, 23 Aug 2021 20:41:58 +0200 Subject: [PATCH] Encapsulate the internal SQLite (#684) Add linker flags to - prevent the dynamic linker from using an external SQLite for this library (`-Bsymbolic`) and - prevent the dynamic linker from using the internal SQLite for other libraries (`--exclude-libs ALL`). This is just a (conflict-free) cherry-pick of a Signal-specific fix in https://github.com/signalapp/better-sqlite3/pull/3 that seems OK to upstream further. --- binding.gyp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/binding.gyp b/binding.gyp index 06bbc984..59fa0a81 100644 --- a/binding.gyp +++ b/binding.gyp @@ -13,6 +13,14 @@ 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': ['-std=c++14', '-stdlib=libc++'], }, + 'conditions': [ + ['OS=="linux"', { + 'ldflags': [ + '-Wl,-Bsymbolic', + '-Wl,--exclude-libs,ALL', + ], + }], + ], }, { 'target_name': 'test_extension',