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

gyp: win_delay_load_hook is false again #1667

Closed
mscdex opened this issue May 9, 2015 · 2 comments
Closed

gyp: win_delay_load_hook is false again #1667

mscdex opened this issue May 9, 2015 · 2 comments
Labels
confirmed-bug Issues with confirmed bugs. npm Issues and PRs related to the npm client dependency or the npm registry. windows Issues and PRs related to the Windows platform.

Comments

@mscdex
Copy link
Contributor

mscdex commented May 9, 2015

It looks like when npm was updated recently, one of the floated patches reverted the default value for win_delay_load_hook in addon.gypi.

@mscdex mscdex added confirmed-bug Issues with confirmed bugs. npm Issues and PRs related to the npm client dependency or the npm registry. windows Issues and PRs related to the Windows platform. labels May 9, 2015
@piscisaureus
Copy link
Contributor

Fixed in 64d3210

@Fishrock123
Copy link
Contributor

Ah, noted, I'd forgot to check for that in the npm updates.

Fishrock123 referenced this issue in npm/node May 10, 2015
On Windows, when node or io.js attempts to dynamically load a compiled
addon, the compiled addon tries to load node.exe or iojs.exe again -
depending on which import library the module used when it was linked.
This causes many compiled addons to break when node.exe or iojs.exe are
renamed, because when the binary has been renamed the addon DLL can't
find the (right) .exe file to load its imports from.

This patch gives compiled addon developers an option to overcome this
restriction by compiling a delay-load hook into their binary. The
delay-load hook ensures that whenever a module tries to load imports
from node.exe/iojs.exe, it'll just look at the process image, thereby
making the addon work regardless of what name the node/iojs binary has.

To enable this feature, the addon developer must set the
'win_delay_load_hook' option to 'true' in their binding.gyp file, like
this:

```
{
  'targets': [
    {
      'target_name': 'ernie',
      'win_delay_load_hook': 'true',
      ...
```

Bug: nodejs#751
Bug: nodejs#965
Upstream PR: nodejs/node-gyp#599

PR-URL: nodejs#1251
Reviewed-By: Rod Vagg <[email protected]>

PR-URL: nodejs#1266
Reviewed-By: Ben Noordhuis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. npm Issues and PRs related to the npm client dependency or the npm registry. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

3 participants