Compiling on Arm64

If you've gone through instructions on how to check out and build V8 on a machine that is not x86, you may have ran into a bit of trouble, due to the build system downloading native binaries and then not being able to run them. However, even though using an Arm64 machine to work on V8 is not officially supported, overcoming those hurdles is pretty straightforward.

Bypassing vpython #

fetch v8, gclient sync and other depot_tools commands use a wrapper for python called "vpython". If you see errors related to it, you can define the following variable to use the system's python installation instead:

export VPYTHON_BYPASS="manually managed python not supported by chrome operations"

Building ninja and gn from source #

The first thing to do is to make sure we have native binaries for ninja and gn, and that we pick those instead of the ones in depot_tools. A simple way to do this is to tweak your PATH as follows when installing depot_tools:

export PATH=$PATH:/path/to/depot_tools

This way, you'll be able to use your system's ninja installation, given it's likely to be available. Although if it isn't you can build it from source.

Then you'll need gn, which can be built with:

git clone
cd gn
python build/
ninja -C out

And finally tweak your PATH so that it comes before the gn from depot_tools.

export PATH=/path/to/gn/out:$PATH

Compiling clang #

By default, V8 will want to use its own build of clang that may not run on your machine. You could tweak GN arguments in order to use the system's clang or GCC, however, you may want to use the same clang as upstream, as it will be the most supported version.

You can build it locally directly from the V8 checkout:

./tools/clang/scripts/ --without-android --without-fuchsia \
--gcc-toolchain=/usr --use-system-cmake \

Setting up GN arguments manually #

Convenience scripts may not work by default, instead you'll have to set GN arguments manually following the manual workflow. You can get the usual "release", "optdebug" and "debug" configurations with the following arguments:


Using the system's clang or GCC #

Building with GCC is only a case of disabling compiling with clang:


Note that by default, V8 will link using lld, which requires a recent version of GCC. You can use use_lld=false to switch to the gold linker, or additionally use use_gold=false to use ld.

If you'd like to use the clang that's installed with your system, say in /usr, you can use the following arguments:


However, given the system's clang version may not be well supported, you're likely to deal with warnings, such as unknown compiler flags. In this case it's useful to stop treating warnings as errors with: