Problem linking when implementing V8InspectorClient

171 views
Skip to first unread message

alex...@gmail.com

unread,
Sep 26, 2024, 12:25:53 PM9/26/24
to v8-users
We have code that implements v8_inspector::V8InspectorClient and when we upgraded to V8 13.1.36 (thought he problem looks like it's there up to 13.1.99) we get the following when we try to link:

ld64.lld: error: undefined symbol: typeinfo for v8_inspector::V8InspectorClient
>>> referenced by /Users/imagine/src/inspector.cc
>>> out/arm64.mac.release/obj/inspector.o:(symbol typeinfo for imagine::InspectorClient+0x10)
>>> did you mean: vtable for v8_inspector::V8InspectorClient
>>> defined in: v8/out/arm64.mac.release/obj/libv8_monolith.a(v8-inspector-impl.o)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

This seems to be because the following newish virtual functions in the base class have no default implementation:

virtual void consoleTime(v8::Isolate* isolate, v8::Local<v8::String> label);
virtual void consoleTimeEnd(v8::Isolate* isolate,
v8::Local<v8::String> label);
virtual void consoleTimeStamp(v8::Isolate* isolate,
v8::Local<v8::String> label);

We don't want to use rtti so we locally modified v8-inspector.h to provide an empty implementation for these functions to get around the problem, which worked fine, but, obviously we don't want to do that forever. 

Is there another way around this? Should we submit a change to add default implementations for these functions or will someone else pick this up?

alex...@gmail.com

unread,
Sep 29, 2024, 6:55:42 AM9/29/24
to v8-users
FWIW, I rebuilt V8 after I made the above change to v8-inspector.h and discovered that, in fact, there are default implementations of consoleTime and friends in v8-inspector-impl.cc which, of course, doesn't play nicely with my change to v8-inspector.h but does suggest that there was an intent to have a default implementation for these functions. So just wondering if these can be moved to v8-inspector.h as that tells the compiler not to produce the typeinfo reference for v8_inspector::V8InspectorClient. 

Is it reasonable to submit a PR to make this change? Sorry to be so pushy, but this is a bit of a hassle for us, currently.

Thanks 

Jakob Kummerow

unread,
Sep 30, 2024, 4:42:40 AM9/30/24
to v8-u...@googlegroups.com, Benedikt Meurer
+Benedikt Meurer who made these changes and might have an opinion.


--
 

Jakob Kummerow

unread,
Sep 30, 2024, 7:44:40 AM9/30/24
to v8-u...@googlegroups.com, Benedikt Meurer
Benedikt says off-list that he doesn't have an opinion: moving the empty implementations into v8-inspector.h is fine.

Feel free to upload a patch.

alex...@gmail.com

unread,
Sep 30, 2024, 9:40:44 AM9/30/24
to v8-users
Thanks Jakob and Benedikt! Will do. 
Reply all
Reply to author
Forward
0 new messages