Another update. First of all, let me tell you: I am a bit disappointed for the poor (actually, for the non-existent) support in this group for this issue. Is it really that atypical that someone attempts to build an Android version of V8 using a recent Mac model with the latest tools available? Makes you wonder if Google is really *that* commited to open-source software development, in spirit - as opposed to in letter, as Google clearly is...
Oh well. I finally got version 4.3.60 to compile and produce valid (full, instead of thin) libraries for arm-eabi, arm64, x86, x64 and mips (but no mips64). A modification was needed in \tools\gyp\v8.gyp to do that. Attached is the modified v8.gyp with the modifications. I chose 4.3.60 since it was the last version I could compile by using the steps below. Any versions after this one use the new compilation method (that is, the one where you do not need to specify an ANDROID_NDK_ROOT environment variable) and, it seems, are no longer able to produce fat v8 libraries. A few points of interest if you want to do the same: - This applies for version 4.3.60 only - check your local git copy for a "4.3.60" tag. - You will need *both* Xcode and the Command Line Development tools installed in your machine. - Overwrite the current /tools/gyp/v8.gyp file with the attached one, in order to produce fat (instead of thin) libraries. - This version uses the old compilation method, so be sure to " export ANDROID_NDK_ROOT=~/Path/To/Your/Android/NDK/Folder/ ". - If you attempt to include internationalization support, the system will generate a few ICU library files, but they are all "thin" and cannot be used in your project. I still haven't found a way to make them "fat". - By all means, do include -j16 in your build command (or a similar number); it will speed up the compilation considerably. - VERY IMPORTANT: The debugging agent that was present in version 3.14 is *gone* now, for good. See https://groups.google.com/forum/#!msg/v8-users/pS5tgGXzzHY/qG2txmrfqcAJ . The debugging protocol and related functions, however, are still there; the only thing you need to implement externally is the thread code that creates a socket that sends and receive debugging commands outside the app. Now, to create the Android builds on a (recent model) Mac: - Install depot_tools ( http://dev.chromium.org/developers/how-tos/install-depot-tools ) - Open Terminal, then run the following commands: fetch v8 cd v8 - Using your favorite git client, "checkout 4.3.60" in the v8 folder. - In Terminal, run: gclient sync - Copy the attached file to the /tools/gyp folder, overwriting the existing one. - In Terminal, run: export ANDROID_NDK_ROOT=/The/Full/Path/To/Your/Android/NDK/Folder/ With this, you're ready to build the make commands for the various v8 libraries. In Terminal, run: make android_arm.release -j16 i18nsupport=off make android_arm64.release -j16 i18nsupport=off make android_ia32.release -j16 i18nsupport=off make android_x64.release -j16 i18nsupport=off make android_mipsel.release -j16 i18nsupport=off The new library files are stored in folders called: /out/android_arm.release /out/android_arm64.release /out/android_ia32.release /out/android_x64.release /out/android_mipsel.release Containing these files at each one of these folders: libv8_base.a libv8_libbase.a libv8_libplatform.a libv8_nosnapshot.a libv8_snapshot.a These are the files you want; just remember to choose one of libv8_snapshot.a or libv8_nosnapshot.a depending on your project's needs. Hope this helps for anyone else that might have these issues. El viernes, 17 de julio de 2015, 9:14:55 (UTC-6), Heriberto Delgado escribió: > > Environment: > > - MacBook Pro (Retina, 15-inch, Mid 2014) > - OSX Yosemite (10.10.4) > - Xcode 6.4 > - Android Studio 1.3 RC 1 (141.2071668) > > My intent is to compile V8 as a shared library so I can include it in my > new project as a standalone Javascript engine. > > These are the steps I followed starting July 16, 2015 in order to > accomplish that task: > > 1) Used SourceTree to clone depot_tools into ~/Projects/depot_tools > > 2) Started Terminal, then: > > export PATH=~/Projects/depot_tools:$PATH > > cd Projects > > fetch v8 (took about 15 min.) > > 3) As suggested in https://code.google.com/p/v8-wiki/wiki/D8OnAndroid , > opened ~/Projects/.gclient and added: > > target_os = [‘android’] > > And then, on Terminal: > > cd v8 > > gclient sync —nohooks (15:20 hrs - very slow connection) > > 4) Terminal again, then: > > make android_arm -j16 library=shared > > The process aborts with the following errors: > > > make[1]: *** No rule to make target ‘android_arm.optdebug’. Stop. > > /bin/sh: > ~/Projects/v8/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/mac-x86_64/bin/*-gcc: > > No such file or directory > > make[1]: *** [out/Makefile.android_arm.debug] Error 1 > > make[1]: *** [out/Makefile.android_arm.release] Error 1 > > > No idea what is “optdebug”, so I didn’t pursue any further. The missing > folder, however, was really missing. There was no prebuilt/mac-x86_64/, > just one prebuilt/linux-x86_64/. Renamed the latter to the former, and then > tried again. > > The new error message is: > > /bin/sh: > ~/Projects/v8/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/mac-x86_64/bin/arm-linux-androideabi-gcc: > > cannot execute binary file > > Renamed directories to what they were before (that is, > prebuilt/mac-x86_64/ -> prebuilt/linux-x86_64 ). > > Checked my Android Studio NDK folder in ~/Library/Android/sdk/ndk-bundle, > found folder prebuilt/darwin-x86_64. Copied it to V8’s /prebuilt folder, > renamed it to mac-x86-64. Tried again. > > The compile step failed with these errors: > > > In file included from ../src/libplatform/task-queue.cc:5: > In file included from .././src/libplatform/task-queue.h:8: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/queue:169: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/deque:159: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/__split_buffer:7: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/algorithm:626: > > *~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/cstring:61:10: > **fatal > error: * > * 'string.h' file not found* > #include <string.h> > * ^* > In file included from ../src/libplatform/worker-thread.cc:5: > In file included from .././src/libplatform/worker-thread.h:8: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/queue:169: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/deque:159: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/__split_buffer:7: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/algorithm:626: > > *~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/cstring:61:10: > **fatal > error: * > * 'string.h' file not found* > #include <string.h> > * ^* > In file included from ../src/base/bits.cc:5: > In file included from .././src/base/bits.h:9: > In file included from .././src/base/macros.h:11: > > *~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/cstring:61:10: > **fatal > error: * > * 'string.h' file not found* > #include <string.h> > * ^* > *../src/base/atomicops_internals_x86_gcc.cc:8:10: **fatal error: **'string.h' > file* > * not found* > #include <string.h> > * ^* > 1 error generated. > make[2]: *** > [~/Projects/v8/out/android_arm.debug/obj.host/v8_libbase/src/base/atomicops_internals_x86_gcc.o] > > Error 1 > make[2]: *** Waiting for unfinished jobs.... > CXX(host) > ~/Projects/v8/out/android_arm.debug/obj.host/v8_libbase/src/base/division-by-constant.o > In file included from ../src/base/cpu.cc:5: > In file included from .././src/base/cpu.h:16: > In file included from .././src/base/macros.h:11: > > *~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/cstring:61:10: > **fatal > error: * > * 'string.h' file not found* > #include <string.h> > * ^* > In file included from ../src/libplatform/default-platform.cc:5: > In file included from .././src/libplatform/default-platform.h:8: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/functional:477: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/memory:606: > In file included from > ~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iterator:346: > > *~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/iosfwd:90:10: > **fatal > error: * > * 'wchar.h' file not found* > #include <wchar.h> // for mbstate_t > * ^* > In file included from ../src/base/division-by-constant.cc:9: > In file included from .././src/base/logging.h:8: > > *~/Projects/v8/third_party/llvm-build/Release+Asserts/bin/../include/c++/v1/cstring:61:10: > **fatal > error: * > * 'string.h' file not found* > #include <string.h> > * ^* > 1 error generated. > > > > > At this point, I don’t know what else to do. > > Can you please tell me what am I doing wrong, and how to fix it? Being > able to include V8 as a standalone Javascript engine is vital for my > project, so any help will be greatly appreciated. Thanks in advance! > -- -- v8-users mailing list [email protected] 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
v8.gyp
Description: Binary data
