Bug 380929 - Failed to make by clang-5.0svn
Summary: Failed to make by clang-5.0svn
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-07 08:16 UTC by Leslie Zhai
Modified: 2017-07-04 01:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leslie Zhai 2017-06-07 08:16:54 UTC
Hi KDE developers,

I am building clazy-git by clang-5.0svn

clazy-git: commit 66ac3ee6ff20ee94a041fb6eb90eb4fb2bb3957b
clang-5.0svn: Fedora clang version 5.0.0 (trunk 304519) (based on LLVM 5.0.0svn)

but failed:


Scanning dependencies of target clazy-standalone
[ 98%] Building CXX object CMakeFiles/clazy-standalone.dir/src/ClazyStandaloneMain.cpp.o
[100%] Linking CXX executable bin/clazy-standalone
CMakeFiles/clazy-standalone.dir/src/ClazyStandaloneMain.cpp.o: In function `clang::ast_matchers::hasName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/clang/ASTMatchers/ASTMatchers.h:2242: undefined reference to `clang::ast_matchers::internal::HasNameMatcher::HasNameMatcher(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)'
CMakeFiles/clazy-standalone.dir/src/ClazyStandaloneMain.cpp.o: In function `clang::ast_matchers::internal::matcher_forEachOverridden0Matcher::matches(clang::CXXMethodDecl const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const':
/usr/include/clang/ASTMatchers/ASTMatchers.h:4101: undefined reference to `clang::CXXMethodDecl::overridden_methods() const'
CMakeFiles/clazy-standalone.dir/src/ClazyStandaloneMain.cpp.o:(.data.rel.ro._ZTV15ClazyToolAction[_ZTV15ClazyToolAction]+0x20): undefined reference to `clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*)'
lib/ClangLazy.so: undefined reference to `llvm::Registry<clang::PluginASTAction>::add_node(llvm::Registry<clang::PluginASTAction>::node*)'
lib/ClangLazy.so: undefined reference to `clang::DeclarationName::getCXXDeductionGuideTemplate() const'
lib/ClangLazy.so: undefined reference to `clang::QualType::isTriviallyCopyableType(clang::ASTContext const&) const'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/clazy-standalone.dir/build.make:155: recipe for target 'bin/clazy-standalone' failed
make[2]: *** [bin/clazy-standalone] Error 1
CMakeFiles/Makefile2:142: recipe for target 'CMakeFiles/clazy-standalone.dir/all' failed
make[1]: *** [CMakeFiles/clazy-standalone.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2


I am trying to fix it :)

Regards,
Leslie Zhai
Comment 1 Sergio Martins 2017-06-08 08:54:26 UTC
can you check if clazy 1.1 builds with that version of clang ?
Comment 2 Leslie Zhai 2017-06-08 09:32:26 UTC
clang-5.0svn is able to build clazy v1.1, I am reading the patch diff -Naur clazy-1.1 clazy > clazy.patch
Comment 3 Sergio Martins 2017-06-08 09:46:15 UTC
Builds fine on Archlinux, with clang 5.0 from git

Can you try disabling clazy-standalone from building, and only building clazy plugin ?
Comment 4 Sergio Martins 2017-06-11 18:55:36 UTC
Git commit 754fdceae7de7cbf737af919e28f1a1ec8270189 by Sergio Martins.
Committed on 11/06/2017 at 18:54.
Pushed by smartins into branch '1.2'.

Fix fedora 25 build

Don't link to LLVMSupport if not needed. Respect LLVM_LIBS_LIST.

Might also fix another bug:

M  +8    -5    CMakeLists.txt

https://commits.kde.org/clazy/754fdceae7de7cbf737af919e28f1a1ec8270189
Comment 5 Sergio Martins 2017-06-29 18:13:13 UTC
This should be fixed, please re-test
Comment 6 Leslie Zhai 2017-07-04 01:48:13 UTC
Sorry for late response! worked :)