From c1440bdaa47ffdda852ff576ac543114c4f0fb4b Mon Sep 17 00:00:00 2001 From: jeromew Date: Sat, 4 Feb 2023 07:38:04 +0100 Subject: [PATCH] Fixed rpath linker option when using a custom sqlite (#1654) It seems that an old refactoring (~8 years) made a mistake on the way conditions are expressed in gyp. the "conditions" key cannot be set 2 times and the conditions should be all set in the "conditions" array. The impact of this bug is that when sqlite3 is compiled against a custom sqlite3 source tree, the sqlite3 runtime keeps linking with the system sqlite3 instead of linking to the custom compiled sqlite3 library. In my case that lead to a SIGSEGV upon loading an extension. --- binding.gyp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index f1336f6f7..20d418b3c 100644 --- a/binding.gyp +++ b/binding.gyp @@ -25,8 +25,10 @@ "libraries": [ "-l<(sqlite_libname)" ], - "conditions": [ [ "OS=='linux'", {"libraries+":["-Wl,-rpath=<@(sqlite)/lib"]} ] ], - "conditions": [ [ "OS!='win'", {"libraries+":["-L<@(sqlite)/lib"]} ] ], + "conditions": [ + [ "OS=='linux'", {"libraries+":["-Wl,-rpath=<@(sqlite)/lib"]} ], + [ "OS!='win'", {"libraries+":["-L<@(sqlite)/lib"]} ] + ], 'msvs_settings': { 'VCLinkerTool': { 'AdditionalLibraryDirectories': [