v8 link error when generate cctest.exe

62 views
Skip to first unread message

Amaranth F

unread,
Jun 21, 2018, 2:32:26 AM6/21/18
to v8-users
I use this parameter to generate the ninja project:

gn gen out/Release "--args=is_debug=false target_cpu=\"x64\" v8_static_library=true v8_use_snapshot=true v8_use_external_startup_data=false"

and then run:

ninja -C out\Release

when it finally says:

ninja: Entering directory `out\Release'
[1/58] LINK cctest.exe cctest.exe.pdb
FAILED: cctest.exe cctest.exe.pdb
G:/program/v8new3/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False ../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe /nologo /OUT:./cctest.exe /PDB:./cctest.exe.pdb @./cctest.exe.rsp
G:\program\v8new3\v8\third_party\llvm-build\Release+Asserts\bin\lld-link.exe: error: <root>: undefined symbol: mainCRTStartup

How can I compile it, please?

Quan Chen

unread,
Aug 29, 2018, 10:08:59 AM8/29/18
to v8-users
I'm having the same issue now. And same to you I'm trying to build the static libs of V8.  Have you come up with any solution?

YJ

unread,
Aug 29, 2018, 1:44:37 PM8/29/18
to v8-users
I might have a similar issue but im on linux. At least in my case, the problem is that at "some" point since 6.5, v8's build config for "v8_static_library" starts to do thin archive vs the fat archive(which is more "static"). I've filed a bug but I haven't had time to track down the offending commit as they asked.

I don't know if it is for sure the same problem on windows. So just an FYI.

Quan Chen

unread,
Aug 30, 2018, 2:11:49 AM8/30/18
to v8-users
From what I can see in the static lib template, it looks like the thin archive config is removed:
template("v8_static_library") {
  static_library(target_name) {
    complete_static_lib = true
    forward_variables_from(invoker, "*", [ "configs" ])
    configs += invoker.configs
    configs -= v8_remove_configs
    configs -= [ "//build/config/compiler:thin_archive" ]
    configs += v8_add_configs
  }
}

or is it the same thing you mentioned? 

YJ

unread,
Sep 18, 2018, 5:05:05 PM9/18/18
to v8-users
Hey Quan,

Sorry. I found time to look into my issue again. I am now fairly certain that problem is posix specific. You must have a different issue than what I was thinking.
Reply all
Reply to author
Forward
0 new messages