Is there a way to enable RTTI without editing build files?

86 views
Skip to first unread message

Kenton Varda

unread,
Jul 11, 2017, 3:25:32 PM7/11/17
to v8-u...@googlegroups.com
Hi v8-users,

My code which embeds V8 uses RTTI. My code also defines a custom subclass of v8::ArrayBuffer::Allocator. Since this subclass is defined in my code, RTTI type info is generated. This type info contains a reference to the type info for v8::ArrayBuffer::Allocator. However, since v8 is complied with -fno-rtti, there is no such type info emitted, and I end up with a linker error.

I would therefore like to build V8 with RTTI enabled. The code bloat doesn't matter for my use case. However, it looks like there's currently no way for me to do this without editing build/config/BUILDCONFIG.gn, where no_rtti is unconditionally specified in default_compiler_configs.

Is my understanding correct? If so, would the V8 maintainers accept a patch to make this configurable via a GN variable?

Thanks,
-Kenton

Kenton Varda

unread,
Jul 11, 2017, 4:34:39 PM7/11/17
to v8-u...@googlegroups.com
Whoops, I just discovered that the no_rtti config option itself has an override. Set use_rtti=1, e.g.:

    tools/dev/v8gen.py x64.debug -- use_rtti=true

This seems to do the trick. I was looking for a way to remove the config option from all the places that use it, but overriding the option itself is obviously easier.

-Kenton
Reply all
Reply to author
Forward
0 new messages