Compiling V8 on Linux Arm64

Jul 31, 2025

As you may or may not know, developping software from an aarch64 Linux machine is not that common - and that is no exception for the V8 JavaScript engine. It does officially support building from an Apple Silicon MacOS, but not from Linux aarch64. As my current setup involves compiling from a Linux aarch64 VM, here's how I did it in this context.

TL;DR

  • Get LLVM from https://github.com/llvm/llvm-project/releases and extract it
  • Run gn gen with the following arguments is_debug=true target_os="linux" target_cpu="arm64" v8_enable_temporal_support=false enable_rust=false clang_base_path="/home/user/Downloads/LLVM-21.1.0-rc2-Linux-ARM64" clang_use_chrome_plugins=false
curl https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.0-rc2/LLVM-21.1.0-rc2-Linux-ARM64.tar.xz -o /home/user/Downloads/LLVM-21.1.0-rc2-Linux-ARM64.tar.xz
cd /home/user/Downloads && tar xvf LLVM-21.1.0-rc2-Linux-ARM64.tar.xz
cd /home/user/v8/v8
gn gen out/debug --args='is_debug=true target_os="linux" target_cpu="arm64" v8_enable_temporal_support=false enable_rust=false clang_base_path="/home/user/Downloads/LLVM-21.1.0-rc2-Linux-ARM64" clang_use_chrome_plugins=false'
ninja -C out/debug d8

On my Qemu VM with 8 cores and 16GB RAM the compilation took around 32 minutes. Road to 0x41414141?