-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Cannot build static dll on windows v12.7.0 #28845
Comments
Cc @nodejs/platform-windows |
I guess this might be (at least partially) the snapshot/code cache creator binaries requiring dllimport/dllexport specifiers along the lines of I can try to look into fixing this when I’m in front of a Windows machine. |
Just for some additional info, I was last able to successfully build a shared library on all platforms last on v11.12.0 ... I've never tried on any 12 version. |
The missing reference to |
Not from my end. It's not really my area of expertise, though I can help if there's something to do in our gyp configuration. |
I've tried to manually add |
So it appears this part of v8.gyp isn't actually doing anything when ran (on Windows), and you check the This part of node.gyp is also missing the However, shortly after that, I get the following:
Based on my couple of days understanding, running |
One idea that may work is to just disable code cache and snapshot for shared builds on Windows until we actually fix #27431 (comment) (to disable snapshot, use |
To fix the node lib it self, I guess we could add |
@addaleax To build mkcodecache and mksnapshot (they are executables), we currently build libnode with unresolved symbols, then build the two exectuables with However, if libnode itself is the final product, then we should not build it with unresolved symbols. #28897 added the two stubs for the libnode target when the |
I added another commit in #30647 to implement what I suggested in #28845 (comment) as a temporary fix. Can you try with the two commits and see if it works? |
Just tried it with |
@joyeecheung i took a look at your changes in the #30647 and applied it to
I'll see what I can work out in a few hours and report back. |
@joyeecheung i didn't get any further on my local changes after cherry picking your changes so I decided to pull your PR #30647 locally, but am getting the same error. What I did:
Resulting error:
|
@davidhouweling step 2 should be unnecessary with #30647 because |
So that it's possible to build without code cache (in particular, without building mkcodecache) for testing. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To build mkcodecache and mksnapshot (they are executables), we currently build libnode with unresolved symbols, then build the two exectuables with src/node_snapshot_stub.cc and src/node_code_cache_stub.cc. Each of them write a C++ file to disk when being run. We then use the generated C++ files & libnode (with unresolved symbols) to build the final Node executable. However, if libnode itself is the final product, then we should not build it with unresolved symbols. #28897 added the two stubs for the libnode target when the --shared configure option is used, but it did not get rid of the actions to build and run mksnapshot and mkcodecache for --shared, so to get it working we also need a patch to make sure --shared imply --without-node-code-cache and --without-node-snapshot, until we actually fix the TODO so that mksnapshot and mkcodecache do not use the libnode that way. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
So that it's possible to build without code cache (in particular, without building mkcodecache) for testing. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To build mkcodecache and mksnapshot (they are executables), we currently build libnode with unresolved symbols, then build the two exectuables with src/node_snapshot_stub.cc and src/node_code_cache_stub.cc. Each of them write a C++ file to disk when being run. We then use the generated C++ files & libnode (with unresolved symbols) to build the final Node executable. However, if libnode itself is the final product, then we should not build it with unresolved symbols. #28897 added the two stubs for the libnode target when the --shared configure option is used, but it did not get rid of the actions to build and run mksnapshot and mkcodecache for --shared, so to get it working we also need a patch to make sure --shared imply --without-node-code-cache and --without-node-snapshot, until we actually fix the TODO so that mksnapshot and mkcodecache do not use the libnode that way. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Hi all, As an update, I was able to compile my Windows dll using @davidhouweling 's updated node.gyp from #30695 on 13.5.0 |
@KevinEady that's great to hear. Did you have any issues consuming it in your Windows application? |
Hi @davidhouweling , Yep, just incorporated the new .lib/.dll in project build and .dll at application runtime and all seems well 👍 |
So that it's possible to build without code cache (in particular, without building mkcodecache) for testing. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To build mkcodecache and mksnapshot (they are executables), we currently build libnode with unresolved symbols, then build the two exectuables with src/node_snapshot_stub.cc and src/node_code_cache_stub.cc. Each of them write a C++ file to disk when being run. We then use the generated C++ files & libnode (with unresolved symbols) to build the final Node executable. However, if libnode itself is the final product, then we should not build it with unresolved symbols. #28897 added the two stubs for the libnode target when the --shared configure option is used, but it did not get rid of the actions to build and run mksnapshot and mkcodecache for --shared, so to get it working we also need a patch to make sure --shared imply --without-node-code-cache and --without-node-snapshot, until we actually fix the TODO so that mksnapshot and mkcodecache do not use the libnode that way. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
So that it's possible to build without code cache (in particular, without building mkcodecache) for testing. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To build mkcodecache and mksnapshot (they are executables), we currently build libnode with unresolved symbols, then build the two exectuables with src/node_snapshot_stub.cc and src/node_code_cache_stub.cc. Each of them write a C++ file to disk when being run. We then use the generated C++ files & libnode (with unresolved symbols) to build the final Node executable. However, if libnode itself is the final product, then we should not build it with unresolved symbols. #28897 added the two stubs for the libnode target when the --shared configure option is used, but it did not get rid of the actions to build and run mksnapshot and mkcodecache for --shared, so to get it working we also need a patch to make sure --shared imply --without-node-code-cache and --without-node-snapshot, until we actually fix the TODO so that mksnapshot and mkcodecache do not use the libnode that way. PR-URL: #30647 Refs: #28845 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
I don't believe this has anything left that is actionable. Closing but can reopen if necessary |
Checking out the v12.7.0 tag and attempting to build via
./vcbuild.bat dll openssl-no-asm
Provides the following linking error:
This does not happen when building the normal executable target.
The text was updated successfully, but these errors were encountered: