[LLVMdev] compiling clang with rtti

Olaf Krzikalla Olaf.Krzikalla at tu-dresden.de
Fri Sep 11 05:24:11 PDT 2009


Hi @llvm,

I've already asked the following questions to the clang dev list but got no response. Maybe there is a wider audience at llvmdev and someone here can help me. The question actually boils down to: How can I compile clang with rtti enabled?

And this was my original mail (with some points now better explained) to clang:

<--BEGIN-->
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 (IMHO -fno-rtti should be filtered out in that 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 editing every single Makefile in the "lib" sub-directories and 
commenting out the appropriate line "CXXFLAGS = -fno-rtti".

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 to enable rtti for clang.
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.
<--END-->

Thanks in advance for any help...

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 llvm-dev mailing list