Compiling V8 for Android

825 views
Skip to first unread message

Matt Seegmiller

unread,
Dec 7, 2011, 10:59:48 AM12/7/11
to v8-u...@googlegroups.com
What is the command line to build V8 for Android using the latest GYP build system?  I'm trying to do this on OS X.

I've seen multiple references to people doing this and that fact that it's possible, but I haven't found any documentation for what args need to be passed to make.

Thanks!

matt

Jakob Kummerow

unread,
Dec 8, 2011, 4:06:12 AM12/8/11
to v8-u...@googlegroups.com
On Wed, Dec 7, 2011 at 16:59, Matt Seegmiller <ma...@muzzylane.com> wrote:
What is the command line to build V8 for Android using the latest GYP build system?  I'm trying to do this on OS X.

I've seen multiple references to people doing this and that fact that it's possible, but I haven't found any documentation for what args need to be passed to make.

There's no official way to do that yet. Some of us have hacky experimental patches on our hard drives that we're playing around with. Eventually something will be committed, but we're not there yet and it doesn't have terribly high priority.
 
Thanks!

matt

--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users

Matt Seegmiller

unread,
Dec 8, 2011, 8:30:57 AM12/8/11
to v8-u...@googlegroups.com
On Thu, Dec 8, 2011 at 4:06 AM, Jakob Kummerow <jkum...@chromium.org> wrote:


On Wed, Dec 7, 2011 at 16:59, Matt Seegmiller <ma...@muzzylane.com> wrote:
What is the command line to build V8 for Android using the latest GYP build system?  I'm trying to do this on OS X.

I've seen multiple references to people doing this and that fact that it's possible, but I haven't found any documentation for what args need to be passed to make.

There's no official way to do that yet. Some of us have hacky experimental patches on our hard drives that we're playing around with. Eventually something will be committed, but we're not there yet and it doesn't have terribly high priority.

Hmmmm.... that does explain the lack of documentation. :-)

Is anyone willing to share their hacky experimental patch?  I'm trying to quickly port an existing C++ game engine to Android that uses JavaScript extensively via V8, mostly as a proof of concept.  So I'd be willing to try just about anything, even if it is a bit experimental at this point.

matt

Matt Seegmiller

unread,
Dec 12, 2011, 2:50:55 PM12/12/11
to v8-u...@googlegroups.com
I came across this:


Using the build script wrapper in there, that sets up an NDK toolchain and then builds using scons, I was able to compile V8 for Android successfully.  Is there any gotcha with this method of building V8 for Android I should watch out for?  Also, are there any gotchas of using V8 on Android that I should be aware of in general?

Thanks!

matt

Jakob Kummerow

unread,
Dec 12, 2011, 3:27:52 PM12/12/11
to v8-u...@googlegroups.com
On Mon, Dec 12, 2011 at 20:50, Matt Seegmiller <ma...@muzzylane.com> wrote:
I came across this:


That's a nice find. I like their build setup. I gotta say I'm surprised, though, that it works at all with what little patching they're doing :-)

If you have time, I'd be very interested in what the optimal GCC compiler flags are for building for ARM/Android. There might be a few percent of performance to gain by carefully selecting optimization flags.
 
Using the build script wrapper in there, that sets up an NDK toolchain and then builds using scons, I was able to compile V8 for Android successfully.  Is there any gotcha with this method of building V8 for Android I should watch out for?  Also, are there any gotchas of using V8 on Android that I should be aware of in general?

If it compiles and runs, it seems you've successfully evaded any gotchas.
One thing to be aware of is that the SCons based build is on its way out. By the time we actually delete the SConstruct files, however, the gyp/make based build should provide similarly comfortable support for building for Android, so it shouldn't be much of a hassle for any downstream projects to switch. (ETA for this is unknown, I was hoping Q4, but that's out of the question by now. There'll be plenty of warning.)

Matt Seegmiller

unread,
Dec 12, 2011, 4:27:17 PM12/12/11
to v8-u...@googlegroups.com
On Mon, Dec 12, 2011 at 3:27 PM, Jakob Kummerow <jkum...@chromium.org> wrote:
On Mon, Dec 12, 2011 at 20:50, Matt Seegmiller <ma...@muzzylane.com> wrote:
I came across this:


That's a nice find. I like their build setup. I gotta say I'm surprised, though, that it works at all with what little patching they're doing :-)

If you have time, I'd be very interested in what the optimal GCC compiler flags are for building for ARM/Android. There might be a few percent of performance to gain by carefully selecting optimization flags.

Right now I'm not to the point of worrying too much about optimization.  That could change in a couple months, though, and if it does I'll get back to you.
  
Using the build script wrapper in there, that sets up an NDK toolchain and then builds using scons, I was able to compile V8 for Android successfully.  Is there any gotcha with this method of building V8 for Android I should watch out for?  Also, are there any gotchas of using V8 on Android that I should be aware of in general?

If it compiles and runs, it seems you've successfully evaded any gotchas.
One thing to be aware of is that the SCons based build is on its way out. By the time we actually delete the SConstruct files, however, the gyp/make based build should provide similarly comfortable support for building for Android, so it shouldn't be much of a hassle for any downstream projects to switch. (ETA for this is unknown, I was hoping Q4, but that's out of the question by now. There'll be plenty of warning.)

Yeah, I was aware of that. I was hoping to find a way of building with GYP, but seeing this script and having it work so well, so quickly, I'm happy to use it for the time being.

Thanks again!

matt

Crossle Song

unread,
May 22, 2013, 3:44:22 AM5/22/13
to v8-u...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages