Skip to content

Get the Source

qjivy edited this page Dec 6, 2021 · 20 revisions

The V8 project uses Google's depot_tools to manage the source code. Since RISC-V backend now is maintained all over the upstream, the code can be obtained just follow the guide from here. In short, the steps are:

Table of contents generated with markdown-toc

Installing depot_tools

Clone the depot_tools repository to your system:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/path/to/depot_tools

You may also want to add export PATH=$PATH:/path/to/depot_tools into your shell configuration file (ex. ~/.bashrc) to ensure that this directory is always in your path.

Now, check that depot_tools is correctly installed:

gclient

If this shows the usage information, then your installation is successful.

Checkout V8 Source from Google

Assuming V8_ROOT is defined to some root directory for your v8 work:

mkdir $V8_ROOT
cd $V8_ROOT
fetch v8

You can now browse the original v8 code under $V8_ROOT/v8.

Retrieve the matching dependencies

The gclient tool will retrieve the dependencies that match to this particular branch.

cd $V8_ROOT/v8
gclient sync --with_branch_heads --with_tags

Next, continue to Simulator Build or Cross-compiled Build