Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some c-ares symbols in Node headers not exported by Node executable #8226

Closed
murgatroid99 opened this issue Aug 22, 2016 · 3 comments
Closed
Labels
addons Issues and PRs related to native addons. build Issues and PRs related to build files or the CI. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding.

Comments

@murgatroid99
Copy link
Contributor

murgatroid99 commented Aug 22, 2016

  • Version: 6.3.1
  • Platform:Linux <hostname redacted> 3.13.0-87-generic #133-Ubuntu SMP Tue May 24 18:32:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

The ares.h file in the Node header distribution (the one that node-gyp downloads) contains symbols that are not dynamically exported by the Node binary. For example, ares_gethostbyname appears in that header file, but objdump -T $(which node) shows that that symbol appears nowhere in the dynamic symbol table. Because of this, I can build a native addon using that header without errors, but have it fail to find the symbol when I load it.

@bnoordhuis bnoordhuis added build Issues and PRs related to build files or the CI. addons Issues and PRs related to native addons. labels Aug 22, 2016
@bnoordhuis
Copy link
Member

I don't think it's intentional that c-ares symbols are visible, we should probably tighten up our link step so people don't run into issues like yours. If you want to use c-ares, your best bet is to vendor it with your add-on.

@murgatroid99
Copy link
Contributor Author

If symbols are not supposed to be visible, then those headers shouldn't be there. node-gyp automatically includes that headers directory in the include path, so any headers there override any vendored headers.

I've had similar issues in the past with OpenSSL. On Windows, for example, the OpenSSL headers are provided but the symbols are not available (#4932), so awkward workarounds are needed to compile against any vendored OpenSSL (or drop in replacement) whose headers aren't identical to those provided by Node.

@mscdex mscdex added the cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. label Aug 22, 2016
@richardlau
Copy link
Member

richardlau commented Mar 24, 2017

c-ares headers have been removed from the release tarballs by #10283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addons Issues and PRs related to native addons. build Issues and PRs related to build files or the CI. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding.
Projects
None yet
Development

No branches or pull requests

4 participants