ORC-JIT Missing Typeinfo

Hi all,

I have a software project which is using the ORC JIT system. While upgrading from LLVM 6 (first to 7.0.0, and then to SVN), I’ve encountered some missing typeinfo link errors, even when linking against all LLVM libraries:

…/dist/lib/libarchsim-core.so: undefined reference to typeinfo for llvm::LegacyJITSymbolResolver' ../dist/lib/libarchsim-core.so: undefined reference to typeinfo for llvm::orc::SymbolResolver’

Should I not be using these classes? Am I missing a library or dependency? Have I miscompiled LLVM?

Thanks,
Harry Wagstaff

Harry Wagstaff via llvm-dev <llvm-dev@lists.llvm.org> writes:

I have a software project which is using the ORC JIT system. While
upgrading from LLVM 6 (first to 7.0.0, and then to SVN), I've encountered
some missing typeinfo link errors, even when linking against all LLVM
libraries:

../dist/lib/libarchsim-core.so: undefined reference to `typeinfo for
llvm::LegacyJITSymbolResolver'
../dist/lib/libarchsim-core.so: undefined reference to `typeinfo for
llvm::orc::SymbolResolver'

Should I not be using these classes? Am I missing a library or dependency?
Have I miscompiled LLVM?

LLVM is compiled without run-time type information by default (ie, with
-fno-rtti). I'm guessing you've built the project that's linking to llvm
with RTTI, so it has references to typeinfo that LLVM isn't providing.

The simplest ways to work around this are probably to either build your
project without rtti, or to build llvm with it. I believe the cmake flag
is -DLLVM_ENABLE_RTTI or so.