I've been using Chrome since release and love more and more. Chrome is maximized on my desktop all the time and I'm crusing the Net with shortcut keys.
Chrome on Android is rumored. And amazingly V8 the Javascript engine is already ported to ARM. I couldn't wait for Android Chrome, so tried to build V8 for Zaurus.
First of all, grab the source code.
svn checkout http://v8.googlecode.com/svn/trunk/ v8I tried to cross compile by modifing scons scripts, but no luck. Next I tried to port scons itself to Angstrom but so many problems, then forgot about it.
Quick dirty hack. Batch build, I tried.
First dry run scons on PC to generate script file.
$ scons -nQ toolchain=gcc arch=arm library=static os=linux sample=shell > build.sh 2>&1Copy it and add #!/bin/sh at the fist line, add executable permission and fire it.
# ./build.shIt looks V8 is really ported to ARM. It is promissing. I modified build.sh adding;
src/macro-assembler-arm.cc:66:2: error: #error "for thumb inter-working we require architecture v5t or above"
-march=armv5te -mtune=xscaleto tell compile generate Armv5t binary. There is a little patch required to compile platform-linux.cc
diff -ur --exclude .o v8/src/platform-linux.cc v8-work/src/platform-linux.ccAnother and final touch to build.sh is required to avoid JS2C script. Commnet out JS2C line and copy libraries.cc from PC. I guess this libraries.cc is platform independent, so just scons on PC and pull obj/relrease/libraries.cc to Zaurus.
--- v8/src/platform-linux.cc 2008-09-03 11:42:30.000000000 +0900
+++ v8y-work/src/platform-linux.cc 2008-09-07 11:02:35.226762251 +0900
@@ -567,8 +567,10 @@
ucontext_t* ucontext = reinterpret_cast(context);
mcontext_t& mcontext = ucontext->uc_mcontext;
#if defined (__arm__) || defined(__thumb__)
- sample.pc = mcontext.gregs[R15];
- sample.sp = mcontext.gregs[R13];
+ // sample.pc = mcontext.gregs[R15];
+ // sample.sp = mcontext.gregs[R13];
+ sample.pc = mcontext.arm_pc;
+ sample.sp = mcontext.arm_sp;
#else
sample.pc = mcontext.gregs[REG_EIP];
sample.sp = mcontext.gregs[REG_ESP];
Finally I got libv8.a and shell program
# file shellI tried to run benchmark script in source tree but the program dies in out of memory.
shell: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14,
dynamically linked (uses shared libs), not stripped
# ./shell
V8 version 0.3.0
> for (var n in function() { return this } () ) print(n)
n
escape
unescape
decodeURI
decodeURIComponent
encodeURI
encodeURIComponent
load
quit
version
> quit()
~/work/v8/benchmarks# ../shell run.js
#
# Fatal error in CALL_HEAP_FUNCTION
# Allocation failed - process out of memory
#
Aborted
Conclusion. V8 does run on ARM. V8 on Android will be possible once source code becomes available.
Cheers,
Keep up the good work!
PS: Confirmation code = android? Lol :)