[LLVMdev] llvm-config --cxxflags does not give the result the configuration script wants?

=?utf-8?Q?=C3=93scar_Fuentes?= ofv at wanadoo.es
Wed Mar 14 07:08:47 PDT 2012


Jun-qi Deng <dengjunqi06323011 at gmail.com> writes:

> I got your point. Thank you, and I'd like to provide the relative message
> now. But firstly, what do you mean by the "relevant command generated by
> your makefile"? What I can tell you now is:
>
> The Error Message:
> make[3]: Entering directory `/home/tang.kk/ppcg/ppcg/isl/interface'
>   CXXLD  extract_interface
> extract_interface.o:(.data.rel.ro._ZTI13MyASTConsumer[typeinfo for
> MyASTConsumer]+0x10): undefined reference to `typeinfo for
> clang::ASTConsumer'
> collect2: ld returned 1 exit status

[snip]

So you define a class MyAstConsumer that derives from clang::ASTConsumer
and then the link fails because the typinfo for MyAstConsumer can not
reference the typeinfo of clang::ASTConsumer, because the latter is
undefined as a consecuence of building Clang with -fno-rtti.

In this case the right thing is to apply -fno-rtti to the specific
source file that defines MyAstConsumer.

Please note that deriving from a Clang/LLVM class is not something that
all projects do. The typical compiler that uses LLVM as a backend does
not need to derive from LLVM classes at all. Imposing -fno-rtti on those
projects most likely would cause breakage on user's code.



More information about the llvm-dev mailing list