[LLVMdev] llvm-config --cxxflags is not consistent when building by cmake.
baldrick at free.fr
Thu Nov 22 01:55:55 PST 2012
On 22/11/12 09:41, Óscar Fuentes wrote:
> Luba Tang <lubatang at gmail.com> writes:
>> We found `llvm-config --cxxflags' does not have -fno-exceptions -fno-rtti
>> when using cmake to build LLVM.
>> Does anyone know how to fix it?
> Using -fno-rtti and -fno-exceptions is an internal LLVM policy. There is
> no reason to impose it on client code.
actually it does impact external code. For example dragonegg does
This file contains
// This causes operator= above to be invoked for every -load option.
static cl::opt<PluginLoader, false, cl::parser<std::string> >
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("pluginfilename"),
cl::desc("Load the specified plugin"));
If dragonegg is compiled with RTTI then linking fails because there is no RTTI
for the cl::opt class. Thus dragonegg is forced to compile with -fno-rtti if
it wants to work with this part of LLVM.
There is also the question of what `llvm-config --cxxflags` is supposed to mean.
Is it supposed to give the flags that LLVM was compiled with? Or is it supposed
to give the flags that users of LLVM must compile themselves with? If it's the
second why does it have optimization levels (-O2), debug info (-g) and so on,
which are not at all required for code using LLVM? To my mind the only thing
that really makes sense if that `llvm-config --cxxflags` gives the flags that
LLVM was compiled with, in which case it should contain -fno-rtti and
-fno-exceptions because LLVM was compiled with those.
More information about the llvm-dev