Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Link with the dependencies of rust-core (#351)
Browse files Browse the repository at this point in the history
* Link with the dependencies of rust-core

When linking against a static library you must explicitly link against
the dependencies of that static library.  These are the libraries
which rust itself links against to create libdeltachat.so, you can see
this using `readelf -d libdeltachat.so`.  The interesting thing is
that all these libraries are actually part of your libc.  And
depending on which libc and which version of libc you use, some
symbols may be available without extra linking.  So many people would
not have noticed these missing links.  There is no need to try to
detect exactly which links are needed since the loading only happens
lazily anyway, so needlessly linking against a lib which should always
be available anyway is fairly harmless.

* Attempt to deal with osx correctly
  • Loading branch information
Floris Bruynooghe authored and ralphtheninja committed Jun 17, 2019
1 parent 45aa7b4 commit 6c0a56a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,22 @@
"deltachat-core-rust",
],
"libraries": [
"../deltachat-core-rust/target/release/libdeltachat.a"
"../deltachat-core-rust/target/release/libdeltachat.a",
"-ldl",
],
"conditions": [
[ "OS == 'mac'", {
"libraries": [
"-framework CoreFoundation",
"-framework CoreServices",
"-framework Security",
"-lresolv",
],
}, { # OS == 'linux'
"libraries": [
"-lm",
"-lrt",
]
}],
],
}, { # system_dc_core == 'true'
Expand Down

0 comments on commit 6c0a56a

Please sign in to comment.