Bug 693857 - Make V8 enabled builds work on armeabi as well as armeabi-v7a
Summary: Make V8 enabled builds work on armeabi as well as armeabi-v7a
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: master
Hardware: PC Android
: P4 normal
Assignee: Tor Andersson
URL:
Keywords: bountiable
Depends on:
Blocks:
 
Reported: 2013-04-12 15:13 UTC by Robin Watts
Modified: 2014-02-17 04:37 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Watts 2013-04-12 15:13:23 UTC
Currently we use a V8 v3.9 as a Javascript engine for MuPDF. We have builds of this that work on windows/linux/macos in both 32 and 64bit targets. We also have an armeabi-v7a build for android.

We would like to have an armeabi build too, but all my attempts at generating one have failed so far; while I can get the code to build and give me a library that links into libmupdf.so, this dies as soon as it loads into the standard Android emulator running a Froyo (armeabi) image with a SIGILL.

Currently therefore, we build without the v8 lib, and javascript is disabled on armeabi phones.

We would gladly pay someone under the bug bounty scheme if they can deliver us an armeabi build of v8 that works with mupdf (without breaking all the above platforms!)

Please ask if anyone interested in taking this on needs any more details.
Comment 1 Robin Watts 2013-04-12 15:15:37 UTC
The source for the version of v8 we are using can be found here:

 http://git.ghostscript.com/?p=user/robin/v8.git/.git;a=shortlog;h=refs/heads/mupdf

We build from the 'mupdf' branch.

Built versions can be found here:

 http://ghostscript.com/~robin/

(see v8-3.9-*)
Comment 2 Kevin Read 2013-05-13 14:53:14 UTC
I'd be interested to look into this. For our latest app we compiled v8 for armv6, although it was a PITA. We're on a newer v8 release though, 3.16 if I remember correctly. I'll look into it over the weekend.
Comment 3 Robin Watts 2013-05-13 15:06:57 UTC
Brilliant! Let us know if you need any help. The easiest way to contact us with quick questions etc is usually to visit us in the #ghostscript irc channel on freenode. See mupdf.com for a link you can use in a modern browser.
Comment 4 Kevin Read 2013-05-17 15:51:22 UTC
I can't clone the repository:
#git clone http://git.ghostscript.com/user/robin/v8.git/
Cloning into 'v8'...
fatal: http://git.ghostscript.com/user/robin/v8.git/info/refs?service=git-upload-pack not found: did you run git update-server-info on the server?
#git clone git://git.ghostscript.com/user/robin/v8.git/.git
Cloning into 'v8'...
fatal: remote error: access denied or repository not exported: /user/robin/v8.git/.git

Am I doing something wring? I'll just build a armeabi binary from 3.9.24 if that is ok with you?
Comment 5 Robin Watts 2013-05-17 16:19:22 UTC
(In reply to comment #4)
> I can't clone the repository:
> #git clone http://git.ghostscript.com/user/robin/v8.git/
> Cloning into 'v8'...
> fatal:
> http://git.ghostscript.com/user/robin/v8.git/info/refs?service=git-upload-
> pack not found: did you run git update-server-info on the server?
> #git clone git://git.ghostscript.com/user/robin/v8.git/.git
> Cloning into 'v8'...
> fatal: remote error: access denied or repository not exported:
> /user/robin/v8.git/.git
> 
> Am I doing something wring? I'll just build a armeabi binary from 3.9.24 if
> that is ok with you?

Try again now? Sorry about that.
Comment 6 Kevin Read 2013-05-22 19:27:03 UTC
As mentioned in IRC you'll have to use a version with hardwired soft floating point (no pun intended).

I built it using the build scripts from titanium, as I'm not familiar with scons.  You can get the stuff from https://github.com/appcelerator/v8_titanium. I just changed the url to your v8 repository in .gitmodules, and a

git submodule init
git submodule update
sh build_v8.sh -n PATH_TO_NDK -j8 -l armeabi -p android-8 -s
sh build_v8.sh -n PATH_TO_NDK -j8 -l x86 -p android-9 -s

will build everything. The output is in build/release/libs. If you want to build the shell demo app, go into the v8 subfolder, and run
../build/ndk_toolchain/bin/i686-linux-android-g++ -DANDROID ./samples/shell.cc -o v8-shell -I include libv8.a -llog
or for arm
../build/ndk_toolchain/bin/arm-linux-androideabi-g++ -DANDROID ./samples/shell.cc -o v8-shell -I include libv8.a -llog
The resulting binary can be pushed to the device or the simulator as per https://code.google.com/p/v8/wiki/D8OnAndroid (using v8-shell instead of d8).

Hope this helps.
Comment 7 Robin Watts 2013-05-27 11:05:15 UTC
Based on your comments, I have built libraries that seem to work. Many thanks.

Please go ahead and claim the bounty. Email miles.jones at artifex.com saying you'd like to collect the bounty for bug 693857 and he'll tell you the information you need to send. Many thanks!
Comment 8 Kevin Read 2013-05-27 12:17:54 UTC
Done and thanks. It was much fun to work on the bug with you. If you ever have anything v8-related to work on again feel free to drop me a line, I'd be happy to work on it again.