On Sat, Apr 28, 2018 at 1:06 AM, A.M. <cis74...@gmail.com> wrote: > I have two questions related to building the v8 as a static library. > > 1. I'm building on Windows and the build fails very close to the end with > this output: > > ninja -C out.gn/x64.debug > ninja: Entering directory `out.gn/x64.debug' > [1/1] Regenerating ninja files > [1441/1543] LINK unittests.exe unittests.exe.pdb > FAILED: unittests.exe unittests.exe.pdb > C:/dev/v8/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe > ../../build/toolchain/win/tool_wrapper.py > link-wrapper environment.x64 False link.exe /nologo /OUT:./unittests.exe > /PDB:./unittests.exe.pdb @./unittests.exe.rsp > LINK : warning LNK4001: no object files specified; libraries used > LINK : error LNK1218: warning treated as error; no output file generated > [1446/1543] CXX obj/test/cctest/cctest_sources/test-code-generator.obj > ninja: build stopped: subcommand failed.Enter code here... > > Apparently, no object files were supplied to the linker, only libraries, > which is a warnings, but warnings are treated as errors, hence it fails the > build. By the time it reaches this point, all v8 libraries are built, so I > can use the v8 for my purposes, but it would be nice if it built as it is > supposed to. > > Anybody has any idea how to remedy this problem? > > 2. Static v8 libraries are build against static VC++ CRT (i.e. with the > `/MT` and `/MTd` flags), which means that they will not pick up any security > updates from MS and also that the project cannot share memory C++ > allocations (i.e. `malloc`/`operator new`), CRT callbacks and some other > things with the rest of the code, so it would need to be completely > encapsulated within its own DLL. I found a really old thread from 2012: > > https://groups.google.com/forum/#!topic/v8-users/PpA3mhICTiM > > , but it's just too old to be of any significance. > > Is there a way to build v8 static libraries against VC++ DLL CRT (i.e. with > `/MD` and `/MDd` flags)? > > Thanks!
I don't know about (1), haven't run into that myself, but apropos (2), the CRT linking logic is effectively hard-coded in build/config/win/BUILD.gn; look for 'default_crt'. You could try sending a CL that adds a build flag to override the default or simply patch the file locally. -- -- 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. For more options, visit https://groups.google.com/d/optout.