Instructions Android build for ARM Processor
Instructions of Android Build for ARM Processor are missing.
As per this page, https://v8.dev/docs/embed
g++ -I. -Iinclude samples/hello-world.cc -o hello_world -lv8_monolith -Lout.gn/arm.release/obj/ -pthread -std=c++0x
Gives error, "error adding symbols: File in wrong format" , (Relocations in generic ELF)
Same command works successfully for x64 build.
Here is what I did,
- tools/dev/v8gen.py arm.release
- Modify
args.gnto
android_unstripped_runtime_outputs = false
is_debug = false
target_cpu = "arm"
target_os = "android"
v8_android_log_stdout = true
v8_target_cpu = "arm"
v8_enable_inspector = true
v8_use_snapshot = false
v8_static_library = true
is_component_build = false
use_custom_libcxx = false
v8_monolithic = true
v8_use_external_startup_data = false
enable_goma = false
ninja -C out.gn/arm.releaseg++ -I. -Iinclude samples/hello-world.cc -o hello_world -lv8_monolith -Lout.gn/arm.release/obj/ -pthread -std=c++0x
Hi @ackava !
Just to double check, on step 4:
g++ -I. -Iinclude samples/hello-world.cc -o hello_world -lv8_monolith -Lout.gn/arm.release/obj/ -pthread -std=c++0x
Is this running on your x64 host using the default g++? If so, it should only be able to target x86 code, do you need to use a cross-compiler instead? Off the top of my head, I think for android it should be something like arm-linux-androideabi-g++.
Was this fixed by https://github.com/v8/v8.dev/pull/365?
Oh no, that PR was only updating debug-arm.md. I'm not familiar with embedding V8 in an Android app, I'm not sure I can help much here :-/.