2
votes

I'm trying to link to LLVM and Clang on Unix, and running into a few issues.

The documentation for llvm-config says that this option will "Print the C++ compiler flags needed to use LLVM headers.", and the example shows compiling the user's code with these flags. Wait, what? Doesn't that mean that, since LLVM is compiled with -fno-rtti, and this is on the list of llvm-config --cxxflags, that nobody, ever, can compile a program that uses RTTI for itself and links to LLVM on Unix?

Why does LLVM need -fno-rtti to include their headers?

1
Maybe the output done by llvm handles the missing information from RTTI? That's just my guess.Jesus Ramos

1 Answers

1
votes

See http://llvm.org/docs/Packaging.html:

LLVM disables RTTI by default. Add REQUIRES_RTTI=1 to your environment while running make to re-enable it. This will allow users to build with RTTI enabled and still inherit from LLVM classes.