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