-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
is_component_build=true mksnapshot.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class v8::Platform * __cdecl v8::platform::CreateDefaultPlatform(int,enum v8::platform::IdleTaskSupport,enum v8::platform::InProcessStackDumping,class v8::TracingController *)" #6172
Comments
@rogerwang I can confirm the issue, and I'd like to offer a hotfix if you are not working on this yet. |
@hujiajie - If you have a patch - I would love to try it |
libplatform is forced to be built as a static library in NW.js, so USING_V8_PLATFORM_SHARED should not be defined for its direct dependents. Instead, the macro should be defined at the same place as USING_V8_SHARED since libplatform is part of the main V8 library now. Refs: nwjs/nw.js#6172
The entire class has already been exported, so MSVC will complain about the redundant BLINK_EXPORT attribute in component build. Refs: nwjs/nw.js#6172 Refs: https://groups.google.com/forum/#!topic/nwjs-general/weTjocUM8U8
The following changes are based on the assumption that BLINK_HOOK_MAP is always for symbols exported by blink_core, just like PLATFORM_HOOK_MAP is for symbols from blink_platform. * WebSharedWorkerImpl.cpp: symbols defined in blink_core will be used inside blink_core, so a forward declaration with the "extern" keyword is enough. The *_EXPORT attribute will break Windows component build. * WebEmbeddedWorkerImpl.cpp: symbols exported by blink_core will be used by blink_modules, so use CORE_EXPORT instead. * WebKit.cpp: symbols exported by blink_core will be used by blink_web, so use CORE_EXPORT instead. * InProcessWorkerMessagingProxy.cpp: symbols are defined and exported by blink_core, so use CORE_EXPORT instead. This is analogous to how webthread_impl_for_worker_scheduler.cc exports PLATFORM_HOOK_MAP symbols. Refs: nwjs/nw.js#6172
@fpn Please see nwjs/v8#2 and nwjs/chromium.src#95 |
Hi @hujiajie , the build did go through, but when I start it - I have trouble loading my native modules:
Is there any magic I need to do for native modules with a component build? They are build with nw-gyp against the same version of nw.js (nwjs 0.25.3) Thank you, |
Hi @hujiajie, I created a simple test case to reproduce the issue outside of our app: set_env.cmd has the environment variables I use for my nw.js native modules build Pointing my regular nw.js build at this test case reveals the result of a simple native computation in the js console: "SHA3SUM 1597842aac52bc9d13fe249d808afbf44da13524759477404c3592ee331173e89fe1cbf21a7e4360990d565fad4643cdb209d80fa41a91dea97e665022c92135" Pointing my component build shows:
|
@fpn Thanks for your test case. The root cause of the issue is that the native addon is linked with nw.lib provided by nw-gyp, so the import table of the native addon will indicate that V8 symbols are imported from nw.dll, which is true for the default non-component build. But for component build, these symbols are actually provided by v8.dll instead of nw.dll, so the Windows dll loader will fail to resolve these symbols and report the above error. Component build is not well supported, but I'll see how to provide a workaround as easy as possible. |
@hujiajie I'll see the native library issue. |
The following changes are based on the assumption that BLINK_HOOK_MAP is always for symbols exported by blink_core, just like PLATFORM_HOOK_MAP is for symbols from blink_platform. * WebSharedWorkerImpl.cpp: symbols defined in blink_core will be used inside blink_core, so a forward declaration with the "extern" keyword is enough. The *_EXPORT attribute will break Windows component build. * WebEmbeddedWorkerImpl.cpp: symbols exported by blink_core will be used by blink_modules, so use CORE_EXPORT instead. * WebKit.cpp: symbols exported by blink_core will be used by blink_web, so use CORE_EXPORT instead. * InProcessWorkerMessagingProxy.cpp: symbols are defined and exported by blink_core, so use CORE_EXPORT instead. This is analogous to how webthread_impl_for_worker_scheduler.cc exports PLATFORM_HOOK_MAP symbols. Refs: nwjs/nw.js#6172
The entire class has already been exported, so MSVC will complain about the redundant BLINK_EXPORT attribute in component build. Refs: nwjs/nw.js#6172 Refs: https://groups.google.com/forum/#!topic/nwjs-general/weTjocUM8U8
The following changes are based on the assumption that BLINK_HOOK_MAP is always for symbols exported by blink_core, just like PLATFORM_HOOK_MAP is for symbols from blink_platform. * WebSharedWorkerImpl.cpp: symbols defined in blink_core will be used inside blink_core, so a forward declaration with the "extern" keyword is enough. The *_EXPORT attribute will break Windows component build. * WebEmbeddedWorkerImpl.cpp: symbols exported by blink_core will be used by blink_modules, so use CORE_EXPORT instead. * WebKit.cpp: symbols exported by blink_core will be used by blink_web, so use CORE_EXPORT instead. * InProcessWorkerMessagingProxy.cpp: symbols are defined and exported by blink_core, so use CORE_EXPORT instead. This is analogous to how webthread_impl_for_worker_scheduler.cc exports PLATFORM_HOOK_MAP symbols. Refs: nwjs/nw.js#6172
The entire class has already been exported, so MSVC will complain about the redundant BLINK_EXPORT attribute in component build. Refs: nwjs/nw.js#6172 Refs: https://groups.google.com/forum/#!topic/nwjs-general/weTjocUM8U8
The entire class has already been exported, so MSVC will complain about the redundant BLINK_EXPORT attribute in component build. Refs: nwjs/nw.js#6172 Refs: https://groups.google.com/forum/#!topic/nwjs-general/weTjocUM8U8
The following changes are based on the assumption that BLINK_HOOK_MAP is always for symbols exported by blink_core, just like PLATFORM_HOOK_MAP is for symbols from blink_platform. * WebSharedWorkerImpl.cpp: symbols defined in blink_core will be used inside blink_core, so a forward declaration with the "extern" keyword is enough. The *_EXPORT attribute will break Windows component build. * WebEmbeddedWorkerImpl.cpp: symbols exported by blink_core will be used by blink_modules, so use CORE_EXPORT instead. * WebKit.cpp: symbols exported by blink_core will be used by blink_web, so use CORE_EXPORT instead. * InProcessWorkerMessagingProxy.cpp: symbols are defined and exported by blink_core, so use CORE_EXPORT instead. This is analogous to how webthread_impl_for_worker_scheduler.cc exports PLATFORM_HOOK_MAP symbols. Refs: nwjs/nw.js#6172
libplatform is forced to be built as a static library in NW.js, so USING_V8_PLATFORM_SHARED should not be defined for its direct dependents. Instead, the macro should be defined at the same place as USING_V8_SHARED since libplatform is part of the main V8 library now. Refs: nwjs/nw.js#6172
This is fixed in git and will be available in the next nightly build. |
Here is the workaround for native library issue with component build:
|
libplatform is forced to be built as a static library in NW.js, so USING_V8_PLATFORM_SHARED should not be defined for its direct dependents. Instead, the macro should be defined at the same place as USING_V8_SHARED since libplatform is part of the main V8 library now. Refs: nwjs/nw.js#6172
NWJS Version : 0.25.2
Operating System : windows 10 64 bit
Expected behavior
Trying to build nw.js as component build to reduce link times. Whenever I set is_component_build=true I get this build error:
The args I have set are:
Did run the python .\build\gyp_chromium.py -D component=shared_library ...
I tried with is_debug=true, but that didn't make a difference.
If I do the same without the is_component_build it works.
The text was updated successfully, but these errors were encountered: