Undefined reference to `v8::platform::CreateDefaultPlatform(int)`

930 views
Skip to first unread message

Andre Cunha

unread,
Sep 20, 2016, 1:43:06 PM9/20/16
to v8-users
Hello,

I'm trying to dynamically load libplatform in an application I'm writing. I searched through the available gn options, but I couldn't find an option to build libplatform as a shared object, so I did it by hand:

$ gcc -shared -o libv8_libplatform.so obj/v8_lib{platform,base}/*.o

I use this both in debug and in release mode, but when I link my application against libplatform in release mode, I get "undefined reference to `v8::platform::CreateDefaultPlatform(int)`". This doesn't happen in debug mode. After some investigation, I realized that the aforementioned function is exported in debug mode, but is hidden in release mode:

# Debug
$ nm -C libv8_libplatform.so | grep CreateDefaultPlatform
000000000001ad70 T v8::platform::CreateDefaultPlatform(int)

# Release
$ nm -C libv8_libplatform.so | grep CreateDefaultPlatform
0000000000003b20 t v8::platform::CreateDefaultPlatform(int)

I inspected the ninja files, and realized this happens because object files are compiled with -fvisibility=default in debug mode, and with -fvisibility=hidden in release mode.

So, my question is: is this function not supposed to be used in release applications? Should I, then, link statically against the many individual .o files needed (as the hello-world.cc example does)? If so, what's the best way to do this?

Thanks in advance,
Andre

Jochen Eisinger

unread,
Sep 21, 2016, 4:51:13 AM9/21/16
to v8-users
libplatform currently does not support dynamic linking.

--
--
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.

Jochen Eisinger

unread,
Sep 21, 2016, 4:52:12 AM9/21/16
to v8-users

Andre Cunha

unread,
Sep 21, 2016, 7:23:42 AM9/21/16
to v8-users
Okay. I'll try to link statically, then.

Thank you!
Andre
Reply all
Reply to author
Forward
0 new messages