Skip to content

Commit

Permalink
Fixed rpath linker option when using a custom sqlite (#1654)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeromew authored Feb 4, 2023
1 parent 93affa4 commit c1440bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down

0 comments on commit c1440bd

Please sign in to comment.