build,tools: fix shared library cross-compile#63963
Open
PickBas wants to merge 1 commit into
Open
Conversation
Fixes: nodejs#52664 Signed-off-by: PickBas <sayed.kirill@gmail.com>
Collaborator
|
Review requested:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Windows DLL build
Fixes building Node.js as a shared library on Windows, including cross-compiling (e.g. arm64 on an x64 host).
tools/gen_node_def: parse the PE export table statically instead ofLoadLibrary/GetProcAddress, so a host-arch tool can read a cross-compiled target-archlibnode.dll. Output is byte-identical to the old tool on native x64 builds.node.gyp: when cross-compiling, buildgen_node_deffor the host so it can run during the build, and havegenerate_node_defdepend on that host build. Also linkDbghelp.lib,winmm.lib, andWs2_32.libinto the shared library, and don't defineBUILDING_NODE_EXTENSIONfornode_mksnapshot(it linksnode_basestatically, so its symbols must not be markeddllimport).Testing
Comparing the original gen_node_def with changed (x64):
Attempt of
.deffile generation of the original gen_node_def (arm64):Fixes: #52664