Building from Source

gahaas edited this page Jan 16, 2018 · 9 revisions
Clone this wiki locally

In order to be able to build V8 from scratch on Linux/Mac for x64 please heed the following steps:

Getting the V8 source TL;DR

More in-depth information can be found here.

  1. Install Git

  2. Install depot_tools

  3. Update depot_tools by executing the following into your terminal/shell:

    gclient
  4. Go into the directory where you want to download the V8 source into and execute the following in your terminal/shell:

    fetch v8
    cd v8

Don’t simply git clone the V8 repository!

Building V8 TL;DR

More in-depth information can be found here.

  1. For macOS: install Xcode and accept its license agreement. (If you’ve installed the command-line tools separately, remove them first.)

  2. Make sure that you are in the V8 source directory. If you followed every step up until step 4 above, you’re already at the right location.

  3. Download all the build dependencies by executing the following in your terminal/shell:

    gclient sync
  4. (only on linux, only needed once) Install build dependencies by executing the following in your terminal/shell:

    ./build/install-build-deps.sh
  5. Generate the necessary build files by executing the following in your terminal/shell:

    tools/dev/v8gen.py x64.release
  6. Compile the source by executing the following in your terminal/shell:

    ninja -C out.gn/x64.release
  7. Run the tests by executing the following in your terminal/shell:

    tools/run-tests.py --gn