Static library build fails on Windows: missing symbol mainCRTStartup

232 views
Skip to first unread message

thapari...@gmail.com

unread,
Aug 14, 2018, 2:54:00 PM8/14/18
to v8-dev
V8 build failing for static libs on windows: VS 2017, Windows 10

FAILED: cctest.exe cctest.exe.pdb
ninja -t msvc -e environment.x64 -- ../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe /nologo /OUT:./cctest.exe /PDB:./cctest.exe.pdb @./cctest.exe.rsp
../../third_party/llvm-build/Release+Asserts/bin\lld-link.exe: error: <root>: undefined symbol: mainCRTStartup
ninja: build stopped: subcommand failed.

Build process does create libs but when try to link these to any project:

out.gn\x64.release\obj\v8_base.lib : fatal error LNK1127: library is corrupt

Same results for ia32 target cpu.

FAILED: cctest.exe cctest.exe.pdb
ninja -t msvc -e environment.x86 -- ../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe /nologo /OUT:./cctest.exe /PDB:./cctest.exe.pdb @./cctest.exe.rsp
../../third_party/llvm-build/Release+Asserts/bin\lld-link.exe: error: <root>: undefined symbol: _mainCRTStartup
ninja: build stopped: subcommand failed.

Any help would be appreciated.

Thanks
Ajit

thapari...@gmail.com

unread,
Aug 16, 2018, 12:19:20 PM8/16/18
to v8-dev
Used following configuration (few of these are repeating, kept it that way, just to not miss anything):

use_custom_libcxx_for_host = false
treat_warnings_as_errors = false
v8_enable_i18n_support = false
v8_enable_slow_dchecks = false
is_component_build = false
use_custom_libcxx = false
v8_static_library = true
v8_target_cpu = "x64"
target_cpu = "x64"
is_debug = false
is_clang = false

and targeted build for V8 and the resultant libraries are healthy and likable by VS2017.

command to target build for V8: ninja -C out.gn\x64.release V8
Reply all
Reply to author
Forward
0 new messages