[cfe-dev] Undefined LLVM reference when loading Clang Static Analyzer plugin
Mathieu Baudet
mathieu.baudet at gmail.com
Wed Oct 2 20:05:01 PDT 2013
Hi Gabor,
I was planning on reporting the following issue (or caveat) for some
time. This might explain your problem.
After installing clang in release mode (for me ./configure
--disable-assertions --enable-optimized), the installed binary of
clang cannot load plugins any more. One needs to copy the original
binary manually and strip it with option -x (or not at all).
Failing to do so gives an error comparable to the one you report.
Hoping this helps,
--
Mathieu
2013/10/2 Jordan Rose <jordan_rose at apple.com>:
> Running this through c++filt shows that it's a typeinfo object. I'm still
> not sure why you'd have a reference to it, but perhaps your plugin is being
> compiled with -frtti instead of -fno-rtti?
>
> Jordan
>
>
> On Oct 2, 2013, at 8:59 , Gabor Kozar <kozargabor at gmail.com> wrote:
>
> Hi,
>
> We have a Clang Static Analyzer plugin that registers a bunch of custom
> checkers. We're using LLVM and Clang 3.3.
> Clang 3.3 is able to compile, and the Static Analyzer also runs without our
> plugin being loaded.
>
> On one of our test machines (a Suse Linux 11), trying to load our plugin
> fails:
>
>> clang++ -cc1 -load lib-checkers.so
> error: unable to load plugin 'lib-checkers.so': 'lib-checkers.so: undefined
> symbol: _ZTIN4llvm18RefCountedBaseVPTRE'
>
> Our plugin does not use llvm::RefCountedBaseVPTR, although it does make
> direct use of some LLVM types, such as llvm::Optional, llvm::DenseMap and so
> on.
>
> When building our plugin, we do not link against any LLVM or Clang
> libraries, except for clangASTMatchers. We also tried linking against them,
> but it doesn't seem to make any difference.
> Both Clang and the plugin are built with the same compiler and on the same
> system.
>
> As far as we can determine, this issue only appears when trying to load our
> plugin, and Clang is able to function perfectly when we don't try to load
> it.
>
> Any idea on what could be the issue? We're totally clueless here.
> Thanks!
>
> --
> Gábor Kozár -- ShdNx
> kozargabor at gmail.com
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
More information about the cfe-dev
mailing list