我一直在尝试为Android编译最新的V8,并且能够在这篇文章之后构建静态版本:
Android NDK linking V8 static library: cannot find symbols, but they are there
然而,当我尝试将其与我的JNI代码一起使用时,我仍然会遇到很多错误。
/depot_tools/v8/out/android_arm.release/obj.target/tools/gyp/libv8_base.a(api.o):api.cc:function v8::CheckConstructor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSObject>, char const*): error: undefined reference to 'V8_Fatal'
/depot_tools/v8/out/android_arm.release/obj.target/tools/gyp/libv8_base.a(api.o):api.cc:function v8::Utils::ReportApiFailure(char const*, char const*): error: undefined reference to 'v8::base::OS::PrintError(char const*, ...)'
/depot_tools/v8/out/android_arm.release/obj.target/tools/gyp/libv8_base.a(assembler.o):assembler.cc:function v8::internal::ExternalReference::SetUp(): error: undefined reference to 'v8::base::Mutex::Mutex()'
/depot_tools/v8/out/android_arm.release/obj.target/tools/gyp/libv8_base.a(assembler.o):assembler.cc:function v8::internal::ExternalReference::InitializeMathExpData(): error: undefined reference to 'v8::base::Mutex::Unlock()'
/depot_tools/v8/out/android_arm.release/obj.target/tools/gyp/libv8_base.a(assert-scope.o):assert-scope.cc:function v8::internal::PerThreadAssertScope<(v8::internal::PerThreadAssertType)0, false>::PerThreadAssertScope(): error: undefined reference to 'v8::base::CallOnceImpl(int*, void (*)(void*), void*)'
:
*工作步骤*
有关构建它的更多提示:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
fetch v8
make android_arm.release i18nsupport=off component=static_library -j8
多数民众赞成,不需要建立standalone_static_library。 在android.mk文件中添加以下依赖项:
libv8_base.a
libv8_libbase.a
libv8_libplatform.a
libv8_nosnapshot.a