Attempting to build latest v8 for Android ARM64

26 views
Skip to first unread message

Dustin Breese

unread,
Jan 15, 2026, 2:37:21 PM (7 days ago) Jan 15
to v8-users
Hi,

I'm attempting to build V8 14.3.127.17 for Android ARM64. I'm on OSX, but using Ubuntu 24.04 docker image to perform the V8 build.

I'm able to successfully install all build deps (install-sysroot.py), gclient sync, and even install sysroots (build/linux/sysroot_scripts/install-sysroot.py --arch=arm64)

What I am confused about is how to properly configure the build so that the android-arm64 build can be loaded and works on Android. Should I be using use_custom_libcxx=true or false? Should I be pointing to the NDK libc++ libraries instead?

I've spent several days trying different builds and just can't seem to get anything working or to understand what the proper approach is. I need to embed the v8 engine in my Android app and am currently on a very old V8 version that DOES BUILD (11.3.42). Any pointers would be appreciated!

I'm a bit confused on what build settings I should use. I was able to successfully build the v8 monolith with the following settings, but attempting to build and link the lib_monolith.a on Android seems to have a libc++ mismatch and fails.

Here's the buildable args.gn:

```
target_os="android"
target_cpu="arm64"
v8_target_cpu = "arm64"

clang_use_chrome_plugins=false
dcheck_always_on = false
icu_use_data_file = false
is_component_build=false
is_debug = false
strip_debug_info=true
symbol_level=0
use_libfuzzer=false
v8_android_log_stdout = true
v8_enable_handle_zapping=false
v8_enable_i18n_support=true
v8_enable_pointer_compression=false
v8_enable_test_features=false
v8_enable_webassembly=false
v8_monolithic=true
v8_static_library=true
v8_symbol_level=0
v8_use_external_startup_data=false

# --- NDK Path Configuration ---
android_ndk_root = "/v8build/android-ndk-r29"
android_ndk_version = "r29"

# --- Libc++ Selection ---
# Disables V8's bundled libc++ so it searches the NDK path instead
use_custom_libcxx = true

# --- Essential Build Flags ---
is_clang = true
```

Switching to `use_custom_libcxx=false` fails the v8 build in Docker with:

```
In file included from <module-includes>:1:
gen/third_party/libc++/src/include/__cstddef/byte.h:22:1: error: unknown type name '_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD'
   22 | _LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
      | ^
gen/third_party/libc++/src/include/__cstddef/byte.h:57:41: error: no template named 'is_integral'; did you mean 'std::is_integral'?
   57 | template <class _Integer, __enable_if_t<is_integral<_Integer>::value, int> = 0>
      |                                         ^
...
```

Thanks,
Dustin


Dustin Breese

unread,
Jan 16, 2026, 10:35:42 AM (6 days ago) Jan 16
to v8-users
I'm using a different configuration and keep running into `gen/third_party/libc++/src/include/__cstddef/byte.h:13:10: fatal error: '__fwd/byte.h' file not found`.

```
target_os="android"
target_cpu="arm64"
v8_target_cpu="arm64"

android_ndk_api_level = 27
android_ndk_root = "/v8build/android-ndk-r27d"
android_ndk_version = "r27d"

# false = use ndk's libc++, true (default) = use custom bundled version
use_custom_libcxx = false

# this will tell compiler to use custom bundled libcc for compiling
#use_custom_libcxx_for_host = true

is_component_build=false
v8_monolithic=true
v8_static_library=true
is_clang = true


clang_use_chrome_plugins=false
dcheck_always_on = false
icu_use_data_file = false
is_debug = false
strip_debug_info=true
symbol_level=0
v8_symbol_level=0

use_libfuzzer=false
v8_android_log_stdout = true
v8_enable_handle_zapping=false
v8_enable_i18n_support=true
v8_enable_pointer_compression=false
v8_enable_test_features=false
v8_enable_webassembly=false
v8_use_external_startup_data=false
```

```
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MD -MF obj/build/modules/android-arm64/std_core/module.pcm.d -D_GNU_SOURCE -D__ARM_NEON__=1 -DANDROID -D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -DHAVE_SYS_UIO_H -DANDROID_NDK_VERSION_ROLL=r27d_1 -DCR_CLANG_REVISION=\"llvmorg-22-init-8940-g4d4cb757-84\" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_LIBCPP_BUILDING_LIBRARY -I../.. -Igen -fno-implicit-module-maps -fno-delete-null-pointer-checks -fno-strict-overflow -fno-ident -fno-math-errno -fno-strict-aliasing -fstack-protector -funwind-tables -fPIC -fcolor-diagnostics -fmerge-all-constants -fno-sized-deallocation -fcrash-diagnostics-dir=../../out/clang-crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -split-threshold-for-reg-with-hint=0 -ffp-contract=off -ffunction-sections -fno-short-enums -mbranch-protection=standard --target=aarch64-linux-android27 -mno-outline -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -Xclang -fmodule-file-home-is-cwd -Xclang -fmodules-cache-path=/not_exist_dummy_dir -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -fsanitize=array-bounds -fsanitize-trap=array-bounds -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -fstrict-aliasing -Wundef -fPIC -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-cast-function-type -Wno-thread-safety-reference-return -Wno-nontrivial-memcall -Wno-uninitialized-const-pointer -Werror -Wno-exit-time-destructors -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti --sysroot=../../../android-ndk-r27d/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fvisibility-inlines-hidden -fbuiltin-module-map -fmodule-map-file=gen/third_party/libc++/src/include/module.modulemap -fmodule-map-file=gen/build/modules/android-arm64/module.modulemap -Wno-invalid-offsetof -Wenum-compare-conditional -Wno-nullability-completeness -fmodule-map-file=gen/third_party/libc++/src/include/module.modulemap -fbuiltin-module-map -fmodule-map-file=gen/build/modules/android-arm64/module.modulemap -fmodule-file=obj/build/modules/android-arm64/_Builtin_stddef/module.pcm -fmodule-file=obj/build/modules/android-arm64/_Builtin_stdint/module.pcm -fmodule-file=obj/build/modules/android-arm64/sys_stage1/module.pcm -fmodule-name=std_core -x c++ -Xclang -emit-module -c gen/third_party/libc++/src/include/module.modulemap -o obj/build/modules/android-arm64/std_core/module.pcm
build step: cxx_module "./obj/build/modules/android-arm64/std_core/module.pcm"
siso_rule: clang/cxx_module
stderr:
While building module 'std_core':

In file included from <module-includes>:1:
gen/third_party/libc++/src/include/__cstddef/byte.h:13:10: fatal error: '__fwd/byte.h' file not found
   13 | #include <__fwd/byte.h>
      |          ^~~~~~~~~~~~~~
1 error generated.
```

Reply all
Reply to author
Forward
0 new messages