v8$ echo "target_os = ['android']" >> ../.gclient && gclient sync --nohooks
make android_arm.release -j16 android_ndk_root=[full path to ndk]
r15
tools/android
platform_tools/adb
binary which will be used later; put it in your PATH
or remember where it isadb devices
shows it; you may have to edit udev
rules to give yourself proper permissionsadb shell
to get an ssh-like shell on the device. In that shell, do:cd /data/local/tmp mkdir v8 cd v8
adb push /file/you/want/to/push /data/local/tmp/v8/
Currently two architectures (android_arm
and android_ia32
) are supported, each in debug
or release
mode. The following steps work equally well for both ARM and ia32, on either the emulator or real devices.
make android_arm.release -j16
adb push out/android_arm.release/d8 /data/local/tmp/v8/d8
adb shell /data/local/tmp/v8/d8 <parameters>
.check
suffix to automatically push test binaries and test cases onto the device and run them.make android_arm.release.check
make android_arm.release -j16 adb push out/android_arm.release/d8 /data/local/tmp/v8/d8-version.under.test cp out/android_arm.release/d8 ./d8-version.under.test
adb shell /data/local/tmp/v8/d8-version.under.test benchmark.js --prof adb pull /data/local/tmp/v8/v8.log ./
v8.log
in your favorite editor and edit the first line to match the full path of the d8-version.under.test
binary on your workstation (instead of the /data/local/tmp/v8/
path it had on the device)d8
and an appropriate nm
binary:cp out/ia32.release/d8 ./d8 # only required once tools/linux-tick-processor --nm=$ANDROID_NDK_ROOT/toolchain/bin/arm-linux-androideabi-nm
The static libraries created by the build process are found in out/android_arm.release/obj.target/tools/gyp/
. They are “thin” archives, which means that the .a files contain symbolic links to the .o files used to make the archive. This makes these libraries unusable on any machine but the one that built the library.
A program linking with V8 must link with libv8_libplatform.a
libv8_base.a
libv8_libbase.a
and one of the snapshot libaries such aslibv8_nosnapshot.a
that will be produced if V8 is compiled with the snapshot=off
option.
Unless V8 was compiled with i18nsupport=off
option the program must also link with the International Components for Unicode (ICU) library found in out/android_arm.release/obj.target/third_party/icu/
.
cd firefox/js/src autoconf2.13 ./configure \ --target=arm-linux-androideabi \ --with-android-ndk=$ANDROID_NDK_ROOT \ --with-android-version=21 \ --without-intl-api \ --disable-tests \ --enable-android-libstdcxx \ --enable-pie make adb push -p js/src/shell/js /data/local/tmp/js