Heikki Kultala
2010-Feb-17 11:15 UTC
[LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
We at Tampere University of technology are using LLVM for high-level optimizations in the compiler for our TTA processor toolkit(TCE) We have a llvm backend which creates our own intermediate code, and our own instruction selector after that (as LLVM's machine code cannot represent the actual machine codes of our processors). This makes our llvm backend quite different from the ordinary llvm backends, and we have to link lots of code to same binaries which also link to llvm libraries. LLVM 2.7 is dropping rtti on default build, which is a problem to us. We are using Boost libraries on many places in our code, and Boost has some heavy usage of type info tricks, which cannot be compiled without rtti, so we have to keep rtti on for our code. But our code also implements the llvm backend framework classes, which are compiled without rtti , which causes problems; we cannot derive from the non-rtti enabled base classes with derived classes that are compiled with rtti on. So could rtti be turned on for default builds of llvm so that we could continue using (non-customized) llvm libraries for our compiler? Just having rtti on should not cause you any performance deficits, just causes some extra typeinfo methods to be created to your binaries, and these should be quite small so they should not make them much larger.
Chris Lattner
2010-Feb-17 19:58 UTC
[LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
On Feb 17, 2010, at 3:15 AM, Heikki Kultala wrote:> LLVM 2.7 is dropping rtti on default build, which is a problem to us. > We are using Boost libraries on many places in our code, and Boost has > some heavy usage of type info tricks, which cannot be compiled without > rtti, so we have to keep rtti on for our code. > > But our code also implements the llvm backend framework classes, which > are compiled without rtti , which causes problems; we cannot derive from > the non-rtti enabled base classes with derived classes that are compiled > with rtti on. > > So could rtti be turned on for default builds of llvm so that we could > continue using (non-customized) llvm libraries for our compiler?Hi Heikki, You should be able to get this by doing "make REQUIRES_RTTI=1" when building LLVM. -Chris
Pekka Jääskeläinen
2010-Feb-18 09:54 UTC
[LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
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. Having RTTI support in should not have execution speed penalties, only using the typeinfo does, and binary size benefit is also very small. Seems this has been discussed a while ago, but I'd like to ask to reconsider: http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-January/028970.html 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). 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. It's not easy to get rid of RTTI requiring code for us as we use Boost heavily in our derived MachineFunctionPasses. -- Pekka
Possibly Parallel Threads
- [LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
- [LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
- [LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
- [LLVMdev] Disabling rtti on default build - could it be reverted/re-enabled?
- [LLVMdev] compiling clang with rtti