[cfe-dev] Linking to libclangStaticAnalyzer out-of-tree

Manuel Klimek via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 10 02:58:44 PDT 2015

On Wed, Sep 9, 2015 at 5:11 PM Bhargava Shastry via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
> I plan to implement a stand-alone tool based off of libTooling
> infrastructure that includes both AST and Analyzer Frontend actions.
> Think of it as a clone of clang-check.

We have clang-tidy. Have you seen that? It allows to implement your own AST
based checks, and comes with analyzer checks out of the box.

> I intend to build this tool outside of the LLVM/Clang source tree.
> Naturally, I have added libclangStaticAnalyzer* libraries to the link
> section of my tool's cmake file.
> Problem is, a handful of clang SA symbols are unresolved at link time.
> Most of them have to do with const strings in the
> clang::ento::categories namespace. Any ideas why this is happening and
> how it can be fixed? FWIW, I tried to build against LLVM source tree
> *and* an ubuntu installation of libclang-dev libraries. Both lead to the
> following set of (sample) link-time errors.
> ```
> llvm/tools/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp:200:
> error: undefined reference to
> 'clang::ento::categories::CoreFoundationObjectiveC'
> lvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h:70:
> error: undefined reference to 'clang::ento::categories::LogicError'
> llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp:239:
> error: undefined reference to 'clang::ento::categories::UnixAPI'
> ```
> Thanks,
> Bhargava
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150910/4c7150bc/attachment.html>

More information about the cfe-dev mailing list