Is "monolithic" build of v8 for static linking incompatible with "v8_use_snapshot=true"?

895 views
Skip to first unread message

Ben Ernst

unread,
Oct 29, 2019, 2:07:11 AM10/29/19
to v8-users
Following some frustrations with dynamic linking to V8, I thought I'd try the static linked build.

My platform is VS2017, Windows 10.

My arguments to "gn" (via "v8gen") are as follows:

treat_warnings_as_errors=false
is_component_build=false
v8_enable_i18n_support=false
v8_use_snapshot=true
v8_monolithic=true

When I try to build V8, I get this error:

     [exec] **********************************************************************
     [exec] ** Visual Studio 2017 Developer Command Prompt v15.9.11
     [exec] ** Copyright (c) 2017 Microsoft Corporation
     [exec] **********************************************************************
     [exec] [vcvarsall.bat] Environment initialized for: 'x64'
     [exec] ninja: Entering directory `out.gn/x64.release'
     [exec] [1/1] Regenerating ninja files
     [exec] FAILED: build.ninja
     [exec] ../../buildtools/win/gn.exe --root=../.. -q --check gen .
     [exec] ERROR at //BUILD.gn:3779:3: Assertion failed.
     [exec]   assert(!v8_use_external_startup_data)
     [exec]   ^-----
     [exec] ninja: error: rebuilding 'build.ninja': subcommand failed

Is "v8_monolith" incompatible with "v8_use_snapshot"? How does one get around this problem?

Jakob Gruber

unread,
Oct 29, 2019, 2:27:32 AM10/29/19
to v8-u...@googlegroups.com
Set 

v8_use_external_startup_data = false

to compile the snapshot into the binary. I don't think there's any reason external snapshots would not work in monolithic builds. The assert is likely guarding the fact that the build produces exactly one single file.

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/1ff68a3b-07c3-43f6-aaed-56a8001a7fe8%40googlegroups.com.

Ben Ernst

unread,
Oct 29, 2019, 6:48:15 AM10/29/19
to v8-u...@googlegroups.com
Thank you Jakob, it built successfully with your change, now I just have to link to it.

Ben Ernst

unread,
Nov 1, 2019, 4:44:15 AM11/1/19
to v8-users
Jakob, your tip has helped, thank you. That flag seemed to do the trick.
Ben

Reply all
Reply to author
Forward
0 new messages