Matthieu Moy
2010-Mar-14 10:10 UTC
[LLVMdev] Why does `llvm-config --cxxflags` now include -fno-rtti ?
Hi, I'm trying to port a piece of code using LLVM as a library to the latest SVN version. One difference between 2.6 and 2.7svn is that `llvm-config --cxxflags` now include -fno-rtti. Since my code does use RTTI information (in non-trivial dynamic_cast), my code can't compile with this. Same goes for -fexceptions. I've tried setting my CXXFLAGS to `llvm-config --cxxflags` -frtti -fexceptions, now my code compiles, but it doesn't link against LLVM, giving error messages like: undefined reference to `typeinfo for llvm::TargetMachine' undefined reference to `typeinfo for llvm::MCAsmInfo' (for classes inherinting from the classes named by the error messages) So, I have two questions: * What's the rationale for including -fno-rtti in `llvm-config --cxxflags`? Is this a bug? If not, it should be mentionned in the release notes for 2.7. * How can a user (like me) of the LLVM library derive from LLVM classes and use rtti information? Thanks, -- Matthieu Moy http://www-verimag.imag.fr/~moy/
Óscar Fuentes
2010-Mar-14 19:14 UTC
[LLVMdev] Why does `llvm-config --cxxflags` now include -fno-rtti ?
Matthieu Moy <Matthieu.Moy at grenoble-inp.fr> writes: [snip]> So, I have two questions: > > * What's the rationale for including -fno-rtti in `llvm-config > --cxxflags`? Is this a bug? If not, it should be mentionned in the > release notes for 2.7. > > * How can a user (like me) of the LLVM library derive from LLVM > classes and use rtti information?This was discussed here some weeks (days?) ago. LLVM now defaults to -fno-rtti. There is a setting for enabling RTTI while building LLVM.
Pekka Jääskeläinen
2010-Mar-14 19:46 UTC
[LLVMdev] Why does `llvm-config --cxxflags` now include -fno-rtti ?
On 03/14/2010 12:10 PM, Matthieu Moy wrote:> I'm trying to port a piece of code using LLVM as a library to the > latest SVN version.Here's the recent discussion on this: http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-February/029495.html Summary: no-rtti speeds up LLVM compile time thus developers do not want RTTI on by default, plus it makes the binaries a bit smaller. Distro packagers are asked to enable it by default to allow using LLVM better as a library. -- Pekka Jääskeläinen
Possibly Parallel Threads
- Removing "fno-rtti" flag from llvm-config --cxxflags
- [LLVMdev] llvm-config --cxxflags does not give the result the configuration script wants?
- [LLVMdev] Help with LLVM 3.2 linking error
- [LLVMdev] llvm-config --cxxflags does not give the result the configuration script wants?
- [LLVMdev] llvm-config --cxxflags does not give the result the configuration script wants?