v8/v8.dev

Build breaks in VS 2022 when compiling a monolithic standard library

jgbecker opened this issue · 1 comments

I am trying to build a monolithic, static v8 in a VS 2022 developer command line on Windows.

I use the following configuration file:

is_debug = false
target_cpu = "x86"
v8_monolithic = true
v8_optimized_debug = false
is_component_build = false
v8_static_library = true
use_custom_libcxx = false
use_custom_libcxx_for_host = false
treat_warnings_as_errors = false
v8_enable_i18n_support = false
v8_use_external_startup_data = false

The build process breaks with the following error message:

FAILED: obj/v8_heap_base_headers.lib
..\..\third_party\llvm-build\Release+Asserts\bin\lld-link.exe /lib 
/OUT:obj/v8_heap_base_headers.lib /nologo /WX /ignore:4221  
/llvmlibthin @obj/v8_heap_base_headers.lib.rsp
warning: no input files, not writing output file
         pass /llvmlibempty to write empty .lib file,
         pass /ignore:emptyoutput to suppress warning
treating warning as error due to /WX
lld-link: error: lib failed

When I add

fatal_linker_warnings = false

and, the build breaks only later in the build process, with error

[1743/2146] LINK v8_heap_base_unittests.exe v8_heap_base_unittests.exe.pdb
FAILED: v8_heap_base_unittests.exe v8_heap_base_unittests.exe.pdb
..\..\third_party\llvm-build\Release+Asserts\bin\lld-link.exe /OUT:./v8_heap_base_unittests.exe /nologo -libpath:..\..\third_party\llvm-build\Release+Asserts\lib\clang\15.0.0\lib\windows "-libpath:../../../../../../../Program Files (x86)/Windows Kits/NETFXSDK/4.8/lib/um/x86" "-libpath:../../../../../../../Program Files (x86)/Windows Kits/10/lib/10.0.20348.0/ucrt/x86" "-libpath:../../../../../../../Program Files (x86)/Windows Kits/10/lib/10.0.20348.0/um/x86" /MACHINE:X86  /PDB:./v8_heap_base_unittests.exe.pdb @./v8_heap_base_unittests.exe.rsp
lld-link: error: could not open 'obj/v8_heap_base_headers.lib': no such file or directory
[1747/2146] CXX obj/third_party/inspector_protocol/crdtp_test/json_test.obj
ninja: build stopped: subcommand failed.

Creating an empty library named v8_heap_base_headers.lib in Visual Studio and copying it to obj enables me to complete the build process.

Am I doing anything wrong, or is this a bug in the build script?

Additional question: Is is_clang = false still supposed to work, as it did about 2 years ago, when I last tried this?

Disclaimer: Crossposts here

https://stackoverflow.com/questions/71904877/building-v8-on-windows-vs-2022

and here

https://groups.google.com/g/v8-users/c/aVnVmDKkt8Q

This not the right issue tracker, please use https://v8.dev/bug to file new bugs.