Open meiry opened 3 years ago
I'm running into as well. What's weird is that v8_wrapper appears to be just a header file. I don't think it would even generate a lib file.
@dividebylife need to try to compile older version to test if this happen too
I was able to build by just removing the #include lines for v8_wrapper. But the libs that were generated could not be linked on windows. It's possible that "libs not linking on windows" is a separate problem, though.
I'm experiencing the exact same issue on windows 10 - x64. Any ideas on how this could be resolved?
I'm experiencing the exact same issue on windows 10 - x64. Any ideas on how this could be resolved? No idea if this will help you since the instructions are possibly specific to UnrealJS's fork of v8, but these are the instructions I followed to ultimately get a successful statically linked build with an older version of v8: https://github.com/ncsoft/Unreal.js/wiki/V8
@dividebylife so if its works when your app is in DEBUG and v8 in release i don't think it is problem, the only problem is to check if it works with the newest v8 version
some tried it ? still having failure with the latest v8 build ( i didn't pull the 7.7.299.9999)
C:\Dev\my\v8\depot_tools\v8>cd v8
C:\Dev\my\v8\depot_tools\v8\v8>gn gen out/x64.release -args="v8_use_external_startup_data=false v8_use_snapshot=false v8_enable_i18n_support=false is_debug=false v8_static_library=true is_clang=false"
WARNING at the command-line "--args":1:52: Build argument has no effect.
v8_use_external_startup_data=false v8_use_snapshot=false v8_enable_i18n_support=false is_debug=false v8_static_library=true is_clang=false
^----
The variable "v8_use_snapshot" was set as a build argument
but never appeared in a declare_args() block in any buildfile.
To view all possible args, run "gn args --list <out_dir>"
The build continued as if that argument was unspecified.
Done. Made 162 targets from 85 files in 14494ms
C:\Dev\my\v8\depot_tools\v8\v8>ninja -C out/x64.release v8 v8_libbase v8_libplatform v8_libsampler
ninja: Entering directory `out/x64.release'
[120/1206] LINK bytecode_builtins_list_generator.exe bytecode_builtins_list_generator.exe.pdb
FAILED: bytecode_builtins_list_generator.exe bytecode_builtins_list_generator.exe.pdb
C:/Dev/my/v8/depot_tools/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./bytecode_builtins_list_generator.exe /PDB:./bytecode_builtins_list_generator.exe.pdb @./bytecode_builtins_list_generator.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'obj\v8_wrappers.lib'
Now I'm noticing they are using a modified version of v8 https://github.com/ncsoft/v8 which is not good at all for general use .
I managed to work around that. The key is src/base/platform/wrappers.h
is a header-only file that MSVC doesn't treat fairly. So the hack is simple: let's force MSVC to accept it by creating a dummy .cc file.
Step 1: Create src\base\platform\wrappers.cc
with the following line.
#include "src/base/platform/wrappers.h"
Step 2: Update out.gn\x64.release\obj\v8_wrappers.ninja
with the following lines.
+build obj/v8_wrappers.obj: cxx ../../src/base/platform/wrappers.cc
-build obj/v8_wrappers.lib: alink
+build obj/v8_wrappers.lib: alink obj/v8_wrappers.obj
Step 3: Build v8_wrappers.
ninja -C out.gn/x64.release v8_wrappers
ninja: Entering directory `out.gn/x64.release'
[2/2] LIB obj/v8_wrappers.lib
Voilà, c'est très bien.
Shouldn't this ticket be opened under the main v8 project, not v8.dev?
I have open sourced the step-by-step with patch script for building Windows version. It works for v8.9 and v9.0. Also, I have prepared pre-built V8 for both Linux and Windows.
Good luck!
i followed all the steps from https://v8.dev/docs/build-gn to build release-static v8 lib but I'm getting this error : using VC 2019 , win10 64bit from https://v8.dev/docs/build-gn doing git branch it shows :
the error I'm getting :