Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions Android build for ARM Processor #346

Open
ackava opened this issue Mar 21, 2020 · 3 comments
Open

Instructions Android build for ARM Processor #346

ackava opened this issue Mar 21, 2020 · 3 comments

Comments

@ackava
Copy link

ackava commented Mar 21, 2020

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,

  1. tools/dev/v8gen.py arm.release
  2. Modify args.gn to
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
  1. ninja -C out.gn/arm.release
  2. g++ -I. -Iinclude samples/hello-world.cc -o hello_world -lv8_monolith -Lout.gn/arm.release/obj/ -pthread -std=c++0x
@planglois
Copy link
Contributor

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++.

@RReverser
Copy link
Contributor

Was this fixed by #365?

@planglois
Copy link
Contributor

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 :-/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants