[cfe-dev] compiling clang with RTTI

Olaf Krzikalla Olaf.Krzikalla at tu-dresden.de
Tue Sep 1 09:05:11 PDT 2009

Hi @clang,

I'm somewhat puzzled about using rtti when building clang under gcc (gcc 
4.3.3, linux/ubuntu).
(There is no problem under MSVC since rtti seems to be active there anyway).
The appropriate line 348 in llvm/makefile.rules is commented out meaning 
that llvm is usually compiled using rtti. However every clang lib adds 
-fno-rtti to CXXFLAGS by hand.
This is not filtered out by makefile.rules even if REQUIRES_RTTI is 
defined (which IMHO should be the case).
Now I'm two-way bewildered.
First: why is line 348 commented out? This renders REQUIRES_RTTI 
useless. Does rtti (llvm) and non-rtti (clang) code work together at 
all? I had serious trouble when trying this with my own application and 
eventually resigned .

I'm forced to use rtti in my application as it uses some clang libs but 
also some tr1 stuff (which apparently needs rtti) and boost. This leads 
me to the second question:
How can I compile the clang libs with rtti enabled? Eventually I got it 
by touching every single Makefile in the lib sub-directories and 
commenting out the appropriate line.
However this can't be a proper solution. As stated earlier if 
REQUIRES_RTTI would be evaluated similiar to ENABLE_EXPENSIVE_CHECKS 
regarding rtti then it would be easy.
OTOH I'm not a makefile expert (to be honest I'm very far away from it). 
Thus maybe I'm just overlooking the right way to enable rtti for the 
clang libs.

Best regards
Olaf Krzikalla

Olaf Krzikalla
Technische Universitaet Dresden
Zentrum fuer Informationsdienste und Hochleistungsrechnen
Abteilung Verteiltes und Datenintensives Rechnen
Zellescher Weg 12, 01069 Dresden
Willersbau, Zimmer A105
Telefonnr.: +49 351 463-32442

More information about the cfe-dev mailing list