[cfe-dev] Build problems on svn trunk. Autotools. Definition does not match in clang::ento

Nico Weber thakis at chromium.org
Wed Nov 6 15:17:59 PST 2013


Hi Tim,

I ran into the same issue today. I think what's happening is that you (and
I) first did an in-tree autoconf build, then started an out-of-tree cmake
build, and manually deleted all the autoconf-generated files that cmake
complained about. However,
../llvm-git/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.inc didn't get
deleted (not sure why cmake didn't warn about that one), so the old
autoconf-generated Checkers.inc got picked up by clang during the cmake
build. The fix which worked for me was to run

 rm ../llvm-git/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.inc

Nico (in case anyone else ever websearches for this error message)


On Tue, Aug 13, 2013 at 1:00 AM, Tim Murphy <tnmurphy at gmail.com> wrote:

> Hi,
>
> I had a couple of mysterious build problems on the svn trunk recently
> and I'm not smart enough to fix them but I thought I could at least
> mention them to someone else.  I don't know if the problems are really
> bugs or just my poor reading of the build instructions.
>
> I was building with clang and clang++ 3.3 on Fedora 19 x86_64. I don't
> remember the revision at this point although it was Sunday 11th August
> and must have been on or before r161722.
>
> 1. GNU Autotools build.
> Whatever I did, I couldn't get this to work.  I tried building only
> the x86_64 platform and that caused a lot of failures from pieces of
> code that obviously expected the other platforms to be there.  When I
> built with all the platforms I got almost everything to build but
> still had errors about the MBlaze platform (obviously llvm not clang)
> and then some much more mysterious problems which seemed to be related
> to undefined macros that were clang related.  I forgot to save the
> output from this which is stupid and I'm not greatly eager to repeat
> the experience but I certainly will if asked.  I don't know if
> autotools is supposed to be maintained but if so then it doesn't work
> for me.
>
> 2. Cmake
> With cmake there was eventual success but I had to patch it because I
> reached something very hard to understand that related to namespaces.
> I don't want to submit a full patch because I don't really understand
> the problem and what I did could easily have been incorrect but I
> thought that the registration of checkers was not very uniform and
> seemed to be happening in the wrong namespaces. It might have been a
> clang3.3 bug in the way namespaces are handled - that is the only
> reason I can imagine for everyone else being able to build this and
> not me.
>
> The kind of error I got was:
>
> ========
> [ 96%] Building CXX object
>
> tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/DebugCheckers.cpp.o
>
> /home/tim/build/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp:200:12:
> error:
>       out-of-line definition of 'registerExplodedGraphViewer' does not
> match any declaration in
>       namespace 'clang::ento'
> void ento::registerExplodedGraphViewer(CheckerManager &mgr) {
> ========
>
> e.g. in lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp I had
> to do this kind of thing to get past namespace errors
>
>  #define REGISTER_CHECKER(name) \
> -void ento::register##name(CheckerManager &mgr) {\
> +void clang::ento::register##name(CheckerManager &mgr) {\
>    mgr.registerChecker<SecuritySyntaxChecker>()->filter.check_##name =
> true;\
>  }
>
> And then there were other complaints about other functions that
> weren't declared in the clang:ento namespace but changing them like
> this didn't work (in lib/StaticAnalyzer/Checkers/DebugCheckers.cpp):
>
> -void ento::registerExplodedGraphViewer(CheckerManager &mgr) {
> +void clang::ento::registerExplodedGraphViewer(CheckerManager &mgr) {
>    mgr.registerChecker<ExplodedGraphViewer>();
>  }
>
> only this worked:
>
> -void ento::registerExplodedGraphViewer(CheckerManager &mgr) {
> +namespace clang { namespace ento {
> +void registerExplodedGraphViewer(CheckerManager &mgr) {
>    mgr.registerChecker<ExplodedGraphViewer>();
>  }
> +}}
>
>
> The total list of modified files was:
>
> ndex: lib/Frontend/CMakeLists.txt   (had to add LLVMBitReader for some
> reason)
> Index: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
> Index: lib/StaticAnalyzer/Checkers/DebugCheckers.cpp
> Index: lib/StaticAnalyzer/Checkers/MallocChecker.cpp
> Index: lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
>
> I'm sorry this isn't more detailed or reasoned. Hope it's useful to
> someone.
>
> Regards,
>
> Tim
>
>
>
> --
> You could help some brave and decent people to have access to
> uncensored news by making a donation at:
>
> http://www.thezimbabwean.co.uk/friends/
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131106/8cc1dae4/attachment.html>


More information about the cfe-dev mailing list