Skip to content

Get the Source

Lu Yahan edited this page Jul 22, 2021 · 20 revisions

The V8 project uses Google's depot_tools to manage the source code. For this fork, we will first follow the instructions from v8 and use these tools to retrieve all of the required sources from the core project. Then we will use git directly to retrieve the branch with the RISC-V port.

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.

Checkout the RISC-V Branch

Since the RISC-V port is been upstream, you can build v8-riscv by upstream source. But our Github branch guarantees that RISCV64 can be compiled.

cd $V8_ROOT/v8
git remote add riscv https://github.com/riscv/v8.git
# or alternatively using ssh
git remote add riscv [email protected]:riscv/v8.git
git fetch riscv
git checkout riscv64

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