3

I want a standalone JavaScript library for embedding. I already build V8 and its working correctly, but binary needs two "external data" files. I don want this files.

I was trying to build V8 without "external startup data". I tried to set v8_use_external_startup_data : 0, in build.common.gypi and build/standalone.gypi, but then make is reporting failure at some point.

I'm using following code to build v8:

git clone https://chromium.googlesource.com/chromium/tool/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
fetch v8
gclient sync
cd v8
git checkout branch-heads/5.1
# ... modifying gyni files
make x64.release -j 20

I'm using default, static linking. How I can build V8 without need of natives_blob.bin and snapshot_blog.bin ?

entro
  • 123
  • 6

2 Answers2

3

edit: Since this was posted, V8 now takes ~20-30s to start up without snapshot files. This is up from 2-3s before. It is a known behavior and is not considered to be a bug by the V8 developers, per the v8-users mailing list.

static:

make snapshot=off x64.debug

dynamic:

make snapshot=off library=shared x64.debug

I don't know how to do it for visual studio.

It's important to remember that the build process is constantly being changed by google and that it is optimized for google employees and often horrendously esoteric for anyone outside of google.

xaxxon
  • 17,640
  • 4
  • 42
  • 70
  • @Boinst answer is also correct, I like this one more because it's simpler – entro Mar 09 '17 at 22:07
  • This is no longer a good idea. Current versions of V8 now take a VERY long time to start up without their snapshot files. It used to be ~2-3 seconds, now it's ~20-30 seconds. – xaxxon May 22 '17 at 19:54
2

When using the GYP build process (as you seem to be), pass the argument -Dv8_use_snapshot=false when invoking gyp. That turns off building snapshot data, and you won't need "natives_blob.bin" and "snapshot_blob.bin". My command-line looks like this (for V8 5.3, n.b. the GYP scripts have moved recently):

python.exe gypfiles\gyp_v8 -Dtarget_arch=x64 -Dcomponent=shared_library -Dv8_enable_i18n_support=false -Dv8_use_snapshot=false -G msvs_version=2013
manuell
  • 7,085
  • 5
  • 28
  • 50
Boinst
  • 2,970
  • 2
  • 29
  • 56