V8 compile for cocos2dx android

84 views
Skip to first unread message

Vlad Petreaca

unread,
Oct 4, 2022, 8:46:24 AM10/4/22
to v8-users
Hello,


I compile v8(6.3.1) as shared library for cocos2dx which is been used in android. The projects has 4 ABIs: x86. x86_64, armeabi-v7a and arm64-v8a. It's work fine for x86_64, armeabi and arm64 but the problem is on x86 architecture. 

After I compile v8 for x86 and add it in the prebuild section, I run the project and get this error:

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__moddi3"

I analyzed the library with readelf and I see that is undefined:

$ readelf -Ws libv8.so | grep "__moddi3"
  6666: 00000000     0 FUNC    GLOBAL DEFAULT  UND __moddi3


For the rest of architectures, the library doesn't contain this symbol neither defined or undefined and the app works well.

The NDK that I used for compile it's the default from this version of v8, ndk12

I compile the v8 library using next steps on Ubuntu 16.04(64-bit), Ubuntu 18.04(64-bit) :
  •  git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  • sudo apt-get install -y gcc-multilib
  • export PATH=`pwd`/depot_tools:"$PATH"
  •  fetch v8
  • cd v8
  • git checkout  8cd4009c5b7072ad224f19a9e668ec0ed7430599 - for V8(6.3.1) version
  • echo "target_os = ['android']" >> ../.gclient && gclient sync
  • ./tools/dev/v8gen.py ia32.release
  • add the following arguments on args file:
  1. v8_use_external_startup_data = false
  2. is_official_build = true
  3. is_debug = false
  4. symbol_level = 1
  5. target_cpu = "x86"
  6. v8_target_cpu = "x86"
  7. v8_enable_i18n_support = false
  8. target_os = "android"
  9. v8_android_log_stdout = true
  10. is_component_build = true

Can someone help me? Thanks!

Jakob Kummerow

unread,
Oct 4, 2022, 9:15:15 AM10/4/22
to v8-u...@googlegroups.com
Per crbug.com/v8/9665, which sounds vaguely related, try linking against libcompiler_rt, or provide your own implementation (similar to comment #14 on that bug, just for a different function).

Android/x86 is not a combination we're regularly testing, so it's not surprising that there may be issues.

Also, as I'm sure you're aware, V8 6.3 is very old (5 years), totally unsupported, and 6.3.1 in particular is not a great version to pick. But that's likely unrelated to the problem you're trying to solve.


--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/8d605e6e-74dd-4013-9df9-e40cbc3e44b1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages