FWIW: I played around with the last night for a couple hours and got a release build working using a "component build" and MSVC. It was mostly moving some inline functions and adding some V8_EXPORT_PRIVATE statements (which effectively add the "__declspec(dllexport)" statements to expose functions across DLLs with MSVC). You can see the changes over the current V8 v8.0 branch at https://github.com/v8/v8/compare/8.0-lkgr...billti:v8.0-msvc-fixes?expand=1
This is very rough code, hacking away at one build break at a time until it worked. I'll need to clean it up with a consistent approach before it would be ready for a CL. It also only works for the product binaries & D8 so far (i.e. build with "ninja -C out.gn\x64.release d8"), so I need to fix up the failures when building the test code (which means figuring out some of the subtlety in https://github.com/v8/v8/blob/master/src/base/export-template.h ). Bottom line: It seems fixable without major changes, and should be very low risk (as the V8_EXPORT_* macros effectively compile to nothing in static builds - which is what Chromium and Node.js use for release). - Bill On Wednesday, December 18, 2019 at 10:06:42 AM UTC-8, Bill Ticehurst wrote: > > I'm not clear on what is needed to fix this. The bug has been open quite a > while (see https://bugs.chromium.org/p/v8/issues/detail?id=8791). > > On Tuesday, December 17, 2019 at 12:44:14 PM UTC-8, Ivan Pizhenko wrote: >> >> Hi Bill, so what needs to be fixed to get DLL build (i.e. >> is_component_build=true) built successfully with MSVC compiler? >> I've recently run into the same linking issue with DLL build compiled >> using clang. And to say truth, it's weird that DLL build works only with >> clang. >> p.s. I cannot use prebuilt binaries from nuget and cannot use clang to >> build my app. Need to use strictly MSVC 2017. >> >> - Ivan >> >> On Tuesday, December 17, 2019 at 6:36:12 PM UTC+2, Bill Ticehurst wrote: >>> >>> To be clear, NuGet is a Microsoft run package manager, but "Microsoft" >>> doesn't offer any pre-built V8 binaries. A user account named "pmed" >>> created/uploaded that package, not a Microsoft account. >>> >>> If you are building V8 in a default manner with Clang as it appears, >>> then you can't link it with a project you're building with the MSVC >>> compiler. Those are two different compilers and C++ doesn't have a cross >>> compiler stable ABI (especially if using "custom_libcxx", which means they >>> are also using a different standard C++ library - V8 the Clang provided >>> "libc++", and MSVC will use it's own). >>> >>> If you build V8 with Clang, you'll should build your project with Clang >>> too (ideally using the same build toolchain - i.e. by updating the BUILD.gn >>> file to include a target for your project - the doc at >>> https://v8.dev/docs/embed details the Process and Shell sample apps >>> which build via BUILD.gn and you can follow as an example). If you do >>> decide to build V8 with MSVC, then as mentioned previously, "component >>> build" isn't working currently, and you'll need to static link everything >>> together ("is_component_build = false"), resulting in a large binary, >>> rather than several V8 DLLs and a small application exe). >>> >>> - Bill >>> >>> On Tuesday, December 17, 2019 at 4:31:52 AM UTC-8, Stefan Wörthmüller >>> wrote: >>>> >>>> Note that Microsoft also offers prebuild verrions of v8 via the package >>>> manager or direct to download. >>>> I.e. https://www.nuget.org/packages/v8-v140-x64/ click on "Download" >>>> at the right and rename the archive to zip. Works well for me. >>>> >>>> -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/a0a7c08b-7ff7-40cf-9104-021a97912018%40googlegroups.com.