[llvm-dev] undefined reference to typeinfo for CmpInst

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Fri Feb 19 11:24:09 PST 2016

On Fri, Feb 19, 2016 at 11:09 AM, Frank Winter via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Solved. Recompiling LLVM with "-fno-rtti -fPIC" and building my
> application with "-fno-rtti" solved the issue.

LLVM should already set -fno-rtti by default. I think re-compiling your app
with -fno-rtti is what fixed the undefined typeinfo symbol errors.

It looks like you are linking LLVM static libs into a shared library, so
you also needed to build LLVM with -fPIC. The documented way of doing this
is to pass -DLLVM_ENABLE_PIC=ON to cmake.

> As a result of this experiment I conclude that the LLVM library cannot be
> used in applications that make use of RTTI. I guess that's a bug.

You can enable RTTI by passing -DLLVM_ENABLE_RTTI=ON to cmake. This is
documented here:

It sounds like the real bug is "make the build documentation less
confusing". Sorry about that. =/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160219/ce5380aa/attachment.html>

More information about the llvm-dev mailing list