Build static libnode_internal to avoid cyclic dependency on mkcodecache#28891
Closed
jeroen wants to merge 2 commits intonodejs:masterfrom
jeroen:statlib_master
Closed
Build static libnode_internal to avoid cyclic dependency on mkcodecache#28891jeroen wants to merge 2 commits intonodejs:masterfrom jeroen:statlib_master
jeroen wants to merge 2 commits intonodejs:masterfrom
jeroen:statlib_master
Conversation
Member
|
@nodejs/node-gyp @joyeecheung |
devsnek
reviewed
Jul 31, 2019
| 'NODE_OPENSSL_SYSTEM_CERT_PATH=""', | ||
| ], | ||
|
|
||
| 'sources': [ |
Contributor
Author
|
The bug #27431 has already been fixed via a more simple solution in #28897. Ideally a rewrite of the build as above would probably be better so that we get the same cached symbols when calling libnode from a 3rd party application as in node itself. However this is just a small performance gain and for my purposes the workaround from #28897 suffices. |
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.
Here is a first draft to fix #27431 by implementing exactly this:
node/node.gyp
Lines 1161 to 1166 in 62a809f
The problem here is that the
libnodeshared library is missing the code cache symbols because of the cyclical dependency betweenlibnodeandmkcodecachein node.gyp.We need to build
mkcodecacheto generatenode_code_cache.cc. However currentlymkcodecacheitself depends onlibnodeso we cannot include the generated symbols tolibnode. In the current setupnode_code_cache.ccis linked when buildingnode.exebut when building node as a shared library the symbols are missinglibnode, which causes the issues in #27431.The solution is described comment above: modify the
mkcodecachebuild such that it does not depend on the fulllibnode, but instead on a smallerlibnode_internalwhich suffices to generate the cache symbols. And then we can includenode_code_cache.ccinlibnode.so.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes