[LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
clattner at apple.com
Thu Feb 18 09:57:15 PST 2010
On Feb 18, 2010, at 1:54 AM, Pekka Jääskeläinen wrote:
> On 02/17/2010 09:58 PM, Chris Lattner wrote:
>> You should be able to get this by doing "make REQUIRES_RTTI=1" when building LLVM.
> What is the main reason RTTI is now disabled by default? We discussed
> this briefly in IRC but could not reach a proper conclusion and I was
> directed to ask here for the proper reason against it.
Code size (e.g. on disk) and compile time.
> Having RTTI support in should not have execution speed penalties, only
> using the typeinfo does, and binary size benefit is also very small.
It was ~5% last time I measured it, which is actually quite a big deal.
> It would be better to have the support on by default as having it on should
> not break the majority of clients (RTTI on is the default for g++ at least) to
> the LLVM lib. It now breaks for us, and I have a feeling we are not the only
> ones. Especially now that the shared lib generation has been fixed, I predict
> use cases like ours won't be all that uncommon (clients to libLLVM*.so that
> use also libs like Boost that require RTTI).
The LLVM build system makes it really easy to turn RTTI on if you want it, so I don't see why this is any different than -fexceptions, -fvisibility-inlines-hidden, or one of many other code gen changing flags that you could build LLVM with.
> Mainly this is about a nuisance to need to ask users of TCE to recompile
> LLVM (which might be even installed from a precompiled binary for their distro) to be able to compile TCE.
I'm dubious that doing that would actually work anyway. Since LLVM doesn't provide a stable API, being able to reuse a previously installed version of llvm is not very likely to work.
More information about the llvm-dev