node.js compatibility: visibility of symbols

114 views
Skip to first unread message

Paweł Hajdan, Jr.

unread,
Jan 5, 2011, 12:17:02 PM1/5/11
to v8-u...@googlegroups.com
I'm working on making Gentoo Linux's nodejs package compile against system v8: http://bugs.gentoo.org/show_bug.cgi?id=348609
Passing --shared-v8 to node results in the following error (full log attached to the bug above):

/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:635: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataType()'
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:635: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataType()'
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:635: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataType()'
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:635: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataType()'
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:635: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataType()'
default/src/node_buffer_3.o: In function `node::Buffer::Data(v8::Handle<v8::Object>)':
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:140: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayData()'
default/src/node_buffer_3.o: In function `node::Buffer::HasInstance(v8::Handle<v8::Value>)':
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:635: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataType()'
default/src/node_buffer_3.o: In function `node::Buffer::Length(v8::Handle<v8::Object>)':
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:147: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataLength()'
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:147: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayDataLength()'
default/src/node_buffer_3.o: In function `node::Buffer::Data(v8::Handle<v8::Object>)':
/var/tmp/portage/net-libs/nodejs-0.3.1/work/node-v0.3.1/build/../src/node_buffer.cc:140: undefined reference to `v8::Object::GetIndexedPropertiesExternalArrayData()'
collect2: ld returned 1 exit status


nodejs builds its bundled v8 with visibility=default, which also "fixes" the problem for shared build. However, I'm not sure if that's a good idea, so I created a patch to make those symbols exported instead: http://bugs.gentoo.org/attachment.cgi?id=258953
--- include/v8.h.orig	2011-01-05 17:57:32.000000000 +0100
+++ include/v8.h	2011-01-05 17:57:58.000000000 +0100
@@ -1647,9 +1647,9 @@
       ExternalArrayType array_type,
       int number_of_elements);
   bool HasIndexedPropertiesInExternalArrayData();
-  void* GetIndexedPropertiesExternalArrayData();
-  ExternalArrayType GetIndexedPropertiesExternalArrayDataType();
-  int GetIndexedPropertiesExternalArrayDataLength();
+  V8EXPORT void* GetIndexedPropertiesExternalArrayData();
+  V8EXPORT ExternalArrayType GetIndexedPropertiesExternalArrayDataType();
+  V8EXPORT int GetIndexedPropertiesExternalArrayDataLength();
 
   V8EXPORT static Local<Object> New();
   static inline Object* Cast(Value* obj);
What do you think? Is that the correct solution, or maybe should nodejs stop using those non-exported calls?

Vyacheslav Egorov

unread,
Jan 5, 2011, 12:22:14 PM1/5/11
to v8-u...@googlegroups.com
There is an issue reported for this:
http://code.google.com/p/v8/issues/detail?id=1016
--
Vyacheslav Egorov

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

Søren Gjesse

unread,
Jan 6, 2011, 2:26:32 AM1/6/11
to v8-u...@googlegroups.com
And it should be fixed in r6142.

Regards,
Søren

Paweł Hajdan, Jr.

unread,
Jan 6, 2011, 7:13:34 AM1/6/11
to v8-u...@googlegroups.com
Great, thank you for fixing this so quickly!

2011/1/6 Søren Gjesse <sgj...@chromium.org>
Reply all
Reply to author
Forward
0 new messages