-
Notifications
You must be signed in to change notification settings - Fork 7.3k
windows: addons cannot use the bundled OpenSSL #4051
Comments
There is: the node binary only exports what it uses itself, everything else is stripped at link time. |
Ya I had a feeling that would be the case. So basically the same problem exists on Unix, to a certain extent, but you could get lucky... |
@piscisaureus I know you were working on this, is there a patch to try? |
@TooTallNate https://github.com/joyent/node/compare/openssl-exports It doesn't work on mac yet. |
I meant to spend time comparing |
There are a couple of issues with those switches:
I think someone needs to look into teaching gyp to link with |
Any update on this? I'd love to trim my mariasql addon some more by removing the yaSSL dependency and linking against the bundled OpenSSL instead. Linking to the bundled OpenSSL already works great on Linux, but no go on Windows still. :-( EDIT: I should also note that node-gyp needs to add the openssl directory to the list of include_dirs too. I tried adding the relevant line to my include_dirs in my binding.gyp but for some reason it did not pick it up (node_root_dir isn't defined for binding.gyp and it silently skips it maybe?). |
@mscdex |
Looks like someone was cleaning house and deleted the openssl-exports branch by @piscisaureus. What's the status on making openssl exports available? :-S |
Went ahead and restored the branch. Not sure of the status though. You'll need to ask @piscisaureus about that. |
It would be great to get this one working you guys! FTR I do a similar thing with node-ogg and node-vorbis (i.e. node-ogg re-exports all the symbols from libogg.a, and then vorbis.node dynamically links to ogg.node), but for node-ogg I was able to change the "type" to "shared_library" which made the right thing happen. It seems like this is more complicated since we're stuck with the "executable" gyp type for node. |
+1 I think there are a few modules that bit me related to this |
+9001 |
@tjfontaine Assigning to you because this is kinda related to the stuff you've been working on. Feel free to reassign as you see fit. I think the right approach is for Node to export a consistent API surface for "the stuff Node is using". So, |
@joyent/node-coreteam @mscdex @orangemocha ... where are we at on this one? |
@jasnell I never worked on it, so I really have no idea. |
@tjfontaine Do you have any more updated on this? I would love to get this working :) If there is anything I can do to help I will gladly do so. Unfortunately, I have very limited experience with gyp :( |
Ehh, I in no way meant to unassign you from the bug. I don't even have sufficient privileges in this repo to do so. Seems like a bug in github... |
I'm also happy to help out. Would need some guidance though. |
@TooTallNate ... any further thoughts on this one? |
I still consider it a desirable feature. It would be nice if all the bundled libraries could be linked to by native addons. But I don't think gyp has the necessary skill for it still, as @bnoordhuis was mentioning above, so not sure what we want to do with this issue. |
@TooTallNate ... given that, I'm going to mark this as a |
@TooTallNate, do you have an example/sample of an add-on that can use functions from node's bundled openssl on Linux but not on Windows - I'd like to have a repro to experiment with. |
@vladimir-shcherbakov Sure, this "works" on OS X and Linux, since https://github.com/TooTallNate/node-openssl-addon-example/blob/master/binding.cc Windows does not currently work with that ^ |
Export symbols from the bundled openssl for add-ons to link against. Fixes: nodejs/node-v0.x-archive#4051 PR-URL: #6274 Reviewed-By: James M Snell <[email protected]>
Export symbols from the bundled openssl for add-ons to link against. Fixes: nodejs/node-v0.x-archive#4051 PR-URL: nodejs#6274 Reviewed-By: James M Snell <[email protected]>
Export symbols from the bundled openssl for add-ons to link against. Fixes: nodejs/node-v0.x-archive#4051 PR-URL: #6274 Reviewed-By: James M Snell <[email protected]>
Basically, on Unix, addons can use functions from node's bundled openssl rather easily. So there's no problem there
But on Windows, the openssl functions are not exported it seems. We explicitly export the libuv symbols for addons to use so it would be nice to do the same for OpenSSL.
This wiki article explains the current state of affairs in more detail: https://github.com/TooTallNate/node-gyp/wiki/Linking-to-OpenSSL
@piscisaureus you, me and @ry talked about this privately over email a while back and thought it was something we should get fixed.
The text was updated successfully, but these errors were encountered: