Building v8

2,036 views
Skip to first unread message

Travis Sharp

unread,
Sep 15, 2016, 11:07:57 AM9/15/16
to v8-u...@googlegroups.com
I've followed the current instructions for building v8 with GN on https://github.com/v8/v8/wiki/Building%20with%20GN but after further inspection it looks as if the build only links the .o output instead of creating libraries for use in other applications.

Am I missing a step or is this intended? I am trying to use the output library in another application.

V8 Build-Head 5.4, Linux x64

Jochen Eisinger

unread,
Sep 16, 2016, 1:11:01 AM9/16/16
to v8-u...@googlegroups.com
by default, we build thin archives which are suitable for static linking against other apps, and yes, you will need the .o files around for that.

If you'd rather have shared libraries (.so files), set the gn arg is_component_build = true

br
-jochen

--
--
v8-users mailing list
v8-u...@googlegroups.com
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 v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andre Cunha

unread,
Sep 16, 2016, 10:12:57 AM9/16/16
to v8-users
Hi,

Is there an option to build a shared version of libplatform? I'm upgrading a project I'm working on from v8 5.3 (with static linking) to 5.4 (with dynamic linking), and I use libplatform. I used to link against libv8_libplatform.a, but now I cannot find an option in gn that automatically generates libv8_libplatform.so. As a workaround, I generate the shared library by hand:

$ gcc -shared -o libv8_libplatform.so obj/v8_libplatform/*.o

Is there a better way to do this?

Thank you very much.
Andre

Furious Scissors

unread,
Sep 16, 2016, 1:43:52 PM9/16/16
to v8-users
Ok - i'll try and give that a shot. Are there any plans on upgrading the Embedded Guide to something more recent than v4.8?
If I work this out - would I be able to contribute to the wiki to update it for everyone else?

Jochen Eisinger

unread,
Sep 20, 2016, 3:25:21 AM9/20/16
to v8-users
If you want to build v8 with shared libraries, set the gn arg is_component_build=true

Yes, we intend to update the embedder guide. Contributions or bug reports are always welcome!

Temuri Imnaishvili

unread,
Oct 15, 2016, 4:06:51 PM10/15/16
to v8-users
Jochen,

Facing the same problem. Can you provide us with help on compiling it correctly?

Thanks!

Jochen Eisinger

unread,
Oct 17, 2016, 9:00:18 AM10/17/16
to v8-users
support for compiling libplatform as a shared library landed a few days ago. If you compile with the gn flag is_component_build = true, you should get a shared library

Temuri Imnaishvili

unread,
Oct 17, 2016, 10:19:01 AM10/17/16
to v8-users
I've tried that.

What I need in order to compile v8js is libv8_libplatform.a alongside its .so.

I can still get everything I need if I compile off 5.1.x branch with gyp. Then I'd do this and all would be fine:

echo -e "create /usr/lib/libv8_libplatform.a\naddlib out/native/obj.target/tools/gyp/libv8_libplatform.a\nsave\nend" | sudo ar -M

I've just recompiled v8 with "is_component_build = true", but tools/gyp/libv8_libplatform.a is not being generated.

Could you please explain the problem?

Thanks!

Travis Sharp

unread,
Oct 17, 2016, 2:32:33 PM10/17/16
to v8-u...@googlegroups.com
I had to manually create the .a file. I will see if I can dig up the script I used to generate it.

You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/vEr5qpGNvl4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to v8-users+unsubscribe@googlegroups.com.

Dan ny

unread,
Oct 19, 2016, 5:26:22 PM10/19/16
to v8-users
After finishing the ninja build step, I just ran:

make native library=shared

and the .so libs *eventually* appear in out/native/lib.target

PS. I had no idea about the "is_component_build=true" method  :)

Riccardo Corsi

unread,
Nov 8, 2016, 7:26:27 AM11/8/16
to v8-users
Hi all,

I have the same problem on windows: I don't get the import .lib libraries for v8_libbase, v8_libplatform, etc...
The building process only produces v8.dll.lib, icui18n.dll.lib and icuuc.dll.lib

My setup is:
- v8 head of 5.4 branch
- Windows 10
- Visual Studio 2013

Any suggestions on how to create the needed import libraries?
Thank you!
Reply all
Reply to author
Forward
0 new messages