doc: use llvm-config for bitcoin-tidy example #28245

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:bitcoin_tidy_llvm_config_dir changing 1 files +5 −2
  1. fanquake commented at 12:07 pm on August 9, 2023: member
    An LLVM installation will have llvm-config available to query for info. Ask it for the --cmakedir, and use that in our bitcoin-tidy example, rather than listing multiple different (potential) paths per distro/OS etc.
  2. DrahtBot commented at 12:07 pm on August 9, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK TheCharlatan, theuni, jonatack

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Docs on Aug 9, 2023
  4. TheCharlatan approved
  5. TheCharlatan commented at 12:12 pm on August 9, 2023: contributor
    ACK 8651b998ffc80b2a1b79a47b47f2b54924db0512
  6. fanquake requested review from theuni on Aug 9, 2023
  7. in contrib/devtools/bitcoin-tidy/README:8 in 8651b998ff outdated
     2@@ -3,6 +3,9 @@
     3 Example Usage:
     4 
     5 ```bash
     6-cmake -S . -B build -DLLVM_DIR=/path/to/lib/cmake/llvm -DCMAKE_BUILD_TYPE=Release
     7-make -C build -j$(nproc)
     8+cmake -S . -B build -DLLVM_DIR=$(llvm-config --libdir)/cmake/llvm -DCMAKE_BUILD_TYPE=Release
     9+
    10+cmake --build build -j$(nproc)
    


    jonatack commented at 0:50 am on August 10, 2023:

    Concept ACK on improving the example usage. Any tips on how to make it work with macOS 13.5 arm64? Seeing Undefined symbols for architecture arm64 errors at this step in both versions of this README (thanks!)

      0jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --version
      1cmake version 3.27.1
      2jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake -S . -B build -DLLVM_DIR=$(llvm-config --libdir)/cmake/llvm -DCMAKE_BUILD_TYPE=Release
      3-- The C compiler identification is AppleClang 14.0.3.14030022
      4-- The CXX compiler identification is AppleClang 14.0.3.14030022
      5-- Detecting C compiler ABI info
      6-- Detecting C compiler ABI info - done
      7-- Check for working C compiler: /opt/homebrew/opt/ccache/libexec/cc - skipped
      8-- Detecting C compile features
      9-- Detecting C compile features - done
     10-- Detecting CXX compiler ABI info
     11-- Detecting CXX compiler ABI info - done
     12-- Check for working CXX compiler: /opt/homebrew/opt/ccache/libexec/c++ - skipped
     13-- Detecting CXX compile features
     14-- Detecting CXX compile features - done
     15-- Performing Test HAVE_FFI_CALL
     16-- Performing Test HAVE_FFI_CALL - Success
     17-- Found FFI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libffi.tbd  
     18-- Performing Test Terminfo_LINKABLE
     19-- Performing Test Terminfo_LINKABLE - Success
     20-- Found Terminfo: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurses.tbd  
     21-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")  
     22-- Found zstd: /opt/homebrew/lib/libzstd.dylib  
     23-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd (found version "2.9.13") 
     24-- Found LLVM 16.0.6
     25-- Found clang-tidy: /opt/homebrew/Cellar/llvm/16.0.6/bin/clang-tidy
     26-- Configuring done (1.1s)
     27-- Generating done (0.0s)
     28-- Build files have been written to: /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build
     29jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build -j11                                                                    
     30[ 33%] Building CXX object CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o
     31[ 66%] Building CXX object CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o
     32/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Finder' [-Wunused-parameter]
     33AST_MATCHER(clang::StringLiteral, unterminated)
     34^
     35/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:112:56: note: expanded from macro 'AST_MATCHER'
     36      ::clang::ast_matchers::internal::ASTMatchFinder *Finder,                 \
     37                                                       ^
     38/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Builder' [-Wunused-parameter]
     39/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:113:63: note: expanded from macro 'AST_MATCHER'
     40      ::clang::ast_matchers::internal::BoundNodesTreeBuilder *Builder) const
     41                                                              ^
     422 warnings generated.
     43[100%] Linking CXX shared module libbitcoin-tidy.so
     44Undefined symbols for architecture arm64:
     45  "llvm::SmallVectorBase<unsigned int>::mallocForGrow(void*, unsigned long, unsigned long, unsigned long&)", referenced from:
     46      llvm::SmallVectorTemplateBase<clang::FixItHint, false>::reserveForParamAndGetAddress(clang::FixItHint const&, unsigned long) in logprintf.cpp.o
     47  "llvm::DisableABIBreakingChecks", referenced from:
     48      llvm::VerifyDisableABIBreakingChecks in bitcoin-tidy.cpp.o
     49      llvm::VerifyDisableABIBreakingChecks in logprintf.cpp.o
     50  "llvm::Registry<clang::tidy::ClangTidyModule>::add_node(llvm::Registry<clang::tidy::ClangTidyModule>::node*)", referenced from:
     51      __GLOBAL__sub_I_bitcoin_tidy.cpp in bitcoin-tidy.cpp.o
     52  "clang::ASTNodeKind::getFromNode(clang::Decl const&)", referenced from:
     53      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     54      clang::ast_matchers::internal::HasDeclarationMatcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     55  "clang::ASTNodeKind::getFromNode(clang::Stmt const&)", referenced from:
     56      clang::ast_matchers::internal::matcher_thisPointerType0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     57      clang::ast_matchers::internal::matcher_onImplicitObjectArgument0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     58      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     59      clang::ast_matchers::internal::matcher_callee1Matcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     60      clang::ast_matchers::internal::matcher_callee1Matcher<clang::CXXMemberCallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     61      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CXXMemberCallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     62  "clang::ast_matchers::MatchFinder::addMatcher(clang::ast_matchers::internal::Matcher<clang::Stmt> const&, clang::ast_matchers::MatchFinder::MatchCallback*)", referenced from:
     63      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
     64  "clang::ast_matchers::MatchFinder::MatchCallback::~MatchCallback()", referenced from:
     65      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
     66      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
     67  "clang::ast_matchers::cxxMemberCallExpr", referenced from:
     68      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
     69  "clang::ast_matchers::anyOf", referenced from:
     70      clang::ast_matchers::internal::matcher_thisPointerType0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     71  "clang::ast_matchers::callExpr", referenced from:
     72      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
     73  "clang::ast_matchers::internal::HasNameMatcher::HasNameMatcher(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>)", referenced from:
     74      clang::ast_matchers::hasName(llvm::StringRef) in logprintf.cpp.o
     75  "clang::ast_matchers::internal::DynTypedMatcher::trueMatcher(clang::ASTNodeKind)", referenced from:
     76      clang::ast_matchers::internal::BindableMatcher<clang::QualType> clang::ast_matchers::internal::makeAllOfComposite<clang::QualType>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::QualType> const*>) in logprintf.cpp.o
     77      clang::ast_matchers::internal::BindableMatcher<clang::CXXRecordDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXRecordDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXRecordDecl> const*>) in logprintf.cpp.o
     78      clang::ast_matchers::internal::BindableMatcher<clang::FunctionDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::FunctionDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::FunctionDecl> const*>) in logprintf.cpp.o
     79      clang::ast_matchers::internal::BindableMatcher<clang::StringLiteral> clang::ast_matchers::internal::makeAllOfComposite<clang::StringLiteral>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::StringLiteral> const*>) in logprintf.cpp.o
     80      clang::ast_matchers::internal::BindableMatcher<clang::CallExpr> clang::ast_matchers::internal::makeAllOfComposite<clang::CallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CallExpr> const*>) in logprintf.cpp.o
     81      clang::ast_matchers::internal::BindableMatcher<clang::CXXMethodDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXMethodDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMethodDecl> const*>) in logprintf.cpp.o
     82      clang::ast_matchers::internal::BindableMatcher<clang::CXXMemberCallExpr> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXMemberCallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr> const*>) in logprintf.cpp.o
     83      ...
     84  "clang::ast_matchers::internal::DynTypedMatcher::constructVariadic(clang::ast_matchers::internal::DynTypedMatcher::VariadicOperator, clang::ASTNodeKind, std::__1::vector<clang::ast_matchers::internal::DynTypedMatcher, std::__1::allocator<clang::ast_matchers::internal::DynTypedMatcher>>)", referenced from:
     85      clang::ast_matchers::internal::VariadicOperatorMatcher<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>>::operator clang::ast_matchers::internal::Matcher<clang::Expr><clang::Expr>() && in logprintf.cpp.o
     86      clang::ast_matchers::internal::BindableMatcher<clang::QualType> clang::ast_matchers::internal::makeAllOfComposite<clang::QualType>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::QualType> const*>) in logprintf.cpp.o
     87      clang::ast_matchers::internal::BindableMatcher<clang::CXXRecordDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXRecordDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXRecordDecl> const*>) in logprintf.cpp.o
     88      clang::ast_matchers::internal::BindableMatcher<clang::FunctionDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::FunctionDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::FunctionDecl> const*>) in logprintf.cpp.o
     89      clang::ast_matchers::internal::BindableMatcher<clang::StringLiteral> clang::ast_matchers::internal::makeAllOfComposite<clang::StringLiteral>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::StringLiteral> const*>) in logprintf.cpp.o
     90      clang::ast_matchers::internal::BindableMatcher<clang::CallExpr> clang::ast_matchers::internal::makeAllOfComposite<clang::CallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CallExpr> const*>) in logprintf.cpp.o
     91      clang::ast_matchers::internal::BindableMatcher<clang::CXXMethodDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXMethodDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMethodDecl> const*>) in logprintf.cpp.o
     92      ...
     93  "clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool)", referenced from:
     94      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
     95  "clang::Expr::IgnoreParenImpCasts()", referenced from:
     96      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     97      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CXXMemberCallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     98  "clang::Expr::getReferencedDeclOfCallee()", referenced from:
     99      clang::ast_matchers::internal::HasDeclarationMatcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    100  "clang::tidy::ClangTidyCheck::run(clang::ast_matchers::MatchFinder::MatchResult const&)", referenced from:
    101      vtable for bitcoin::LogPrintfCheck in logprintf.cpp.o
    102  "clang::tidy::ClangTidyCheck::diag(clang::SourceLocation, llvm::StringRef, clang::DiagnosticIDs::Level)", referenced from:
    103      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
    104  "clang::tidy::ClangTidyCheck::ClangTidyCheck(llvm::StringRef, clang::tidy::ClangTidyContext*)", referenced from:
    105      std::__1::__function::__func<void clang::tidy::ClangTidyCheckFactories::registerCheck<bitcoin::LogPrintfCheck>(llvm::StringRef)::'lambda'(llvm::StringRef, clang::tidy::ClangTidyContext*), std::__1::allocator<void clang::tidy::ClangTidyCheckFactories::registerCheck<bitcoin::LogPrintfCheck>(llvm::StringRef)::'lambda'(llvm::StringRef, clang::tidy::ClangTidyContext*)>, std::__1::unique_ptr<clang::tidy::ClangTidyCheck, std::__1::default_delete<clang::tidy::ClangTidyCheck>> (llvm::StringRef, clang::tidy::ClangTidyContext*)>::operator()(llvm::StringRef&&, clang::tidy::ClangTidyContext*&&) in bitcoin-tidy.cpp.o
    106  "clang::tidy::ClangTidyModule::getModuleOptions()", referenced from:
    107      vtable for BitcoinModule in bitcoin-tidy.cpp.o
    108  "clang::tidy::ClangTidyCheckFactories::registerCheckFactory(llvm::StringRef, std::__1::function<std::__1::unique_ptr<clang::tidy::ClangTidyCheck, std::__1::default_delete<clang::tidy::ClangTidyCheck>> (llvm::StringRef, clang::tidy::ClangTidyContext*)>)", referenced from:
    109      BitcoinModule::addCheckFactories(clang::tidy::ClangTidyCheckFactories&) in bitcoin-tidy.cpp.o
    110  "clang::ASTNodeKind::isBaseOf(clang::ASTNodeKind, unsigned int*) const", referenced from:
    111      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
    112  "clang::TemplateName::getAsTemplateDecl() const", referenced from:
    113      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    114  "clang::ast_matchers::MatchFinder::MatchCallback::getCheckTraversalKind() const", referenced from:
    115      vtable for bitcoin::LogPrintfCheck in logprintf.cpp.o
    116  "clang::ast_matchers::internal::ASTMatchFinder::isTraversalIgnoringImplicitNodes() const", referenced from:
    117      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    118      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    119      clang::ast_matchers::internal::HasDeclarationMatcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    120      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CXXMemberCallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    121  "clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const", referenced from:
    122      clang::ast_matchers::internal::matcher_thisPointerType0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    123      clang::ast_matchers::internal::matcher_onImplicitObjectArgument0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    124      clang::ast_matchers::internal::matcher_pointsTo0Matcher::matches(clang::QualType const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    125      clang::ast_matchers::internal::matcher_hasType0Matcher<clang::Expr, clang::ast_matchers::internal::Matcher<clang::QualType>>::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    126      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    127      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    128      clang::ast_matchers::internal::matcher_callee1Matcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    129      ...
    130  "clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const", referenced from:
    131      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
    132  "clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const", referenced from:
    133      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
    134      clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::VariadicFunction<clang::ast_matchers::internal::BindableMatcher<clang::Stmt>, clang::ast_matchers::internal::Matcher<clang::CallExpr>, &clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::makeDynCastAllOfComposite<clang::Stmt, clang::CallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CallExpr> const*>)>::operator()<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>>(clang::ast_matchers::internal::Matcher<clang::CallExpr> const&, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>> const&) const in logprintf.cpp.o
    135      clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::VariadicFunction<clang::ast_matchers::internal::BindableMatcher<clang::Stmt>, clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr>, &clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::makeDynCastAllOfComposite<clang::Stmt, clang::CXXMemberCallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr> const*>)>::operator()<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_callee1Matcher, void (clang::ast_matchers::internal::TypeList<clang::ObjCMessageExpr, clang::CallExpr>), clang::ast_matchers::internal::Matcher<clang::Decl>>, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>>(clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr> const&, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_callee1Matcher, void (clang::ast_matchers::internal::TypeList<clang::ObjCMessageExpr, clang::CallExpr>), clang::ast_matchers::internal::Matcher<clang::Decl>> const&, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>> const&) const in logprintf.cpp.o
    136      clang::ast_matchers::internal::VariadicOperatorMatcher<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>>::operator clang::ast_matchers::internal::Matcher<clang::Expr><clang::Expr>() && in logprintf.cpp.o
    137      clang::ast_matchers::internal::BindableMatcher<clang::QualType> clang::ast_matchers::internal::makeAllOfComposite<clang::QualType>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::QualType> const*>) in logprintf.cpp.o
    138      clang::ast_matchers::internal::BindableMatcher<clang::CXXRecordDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXRecordDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXRecordDecl> const*>) in logprintf.cpp.o
    139      clang::ast_matchers::internal::BindableMatcher<clang::FunctionDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::FunctionDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::FunctionDecl> const*>) in logprintf.cpp.o
    140      ...
    141  "clang::StringLiteral::getLocationOfByte(unsigned int, clang::SourceManager const&, clang::LangOptions const&, clang::TargetInfo const&, unsigned int*, unsigned int*) const", referenced from:
    142      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
    143  "clang::CXXMemberCallExpr::getImplicitObjectArgument() const", referenced from:
    144      clang::ast_matchers::internal::matcher_onImplicitObjectArgument0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    145  "clang::ObjCInterfaceType::getDecl() const", referenced from:
    146      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    147  "clang::InjectedClassNameType::getDecl() const", referenced from:
    148      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    149  "clang::Type::getPointeeType() const", referenced from:
    150      clang::ast_matchers::internal::matcher_pointsTo0Matcher::matches(clang::QualType const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    151  "clang::Type::getUnqualifiedDesugaredType() const", referenced from:
    152      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    153  "clang::TagType::getDecl() const", referenced from:
    154      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    155  "clang::UsingType::getUnderlyingType() const", referenced from:
    156      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    157  "vtable for clang::tidy::ClangTidyCheck", referenced from:
    158      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
    159      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
    160  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
    161ld: symbol(s) not found for architecture arm64
    162clang: error: linker command failed with exit code 1 (use -v to see invocation)
    163make[2]: *** [libbitcoin-tidy.so] Error 1
    164make[1]: *** [CMakeFiles/bitcoin-tidy.dir/all] Error 2
    165make: *** [all] Error 2
    

    fanquake commented at 5:25 am on August 10, 2023:
    Use vanilla LLVM/Clang, Not Apple LLVM/Clang.

    theuni commented at 2:52 pm on August 10, 2023:

    Hmm, LLVM should be header-only, so I think this is indicative of some real problem.

    Could you please paste your link line generated by make VERBOSE=1? For Linux mine is: /usr/bin/c++ -fPIC -O3 -DNDEBUG -shared -o libbitcoin-tidy.so "CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o" "CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o"


    A few possibilities:

    1. Something about the way it’s being compiled/linked makes ld64 grumpy.
    2. Something related to this magic line.

    For 1:

    Could you please try this and seeing if anything changes for better or worse (and see how the link-line changes)?

     0diff --git a/contrib/devtools/bitcoin-tidy/CMakeLists.txt b/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     1index 9ed18696d4..ae168c77af 100644
     2--- a/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     3+++ b/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     4@@ -14,7 +14,7 @@ find_program(CLANG_TIDY_EXE NAMES "clang-tidy-${LLVM_VERSION_MAJOR}" "clang-tidy
     5 message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
     6 message(STATUS "Found clang-tidy: ${CLANG_TIDY_EXE}")
     7
     8-add_library(bitcoin-tidy MODULE bitcoin-tidy.cpp logprintf.cpp)
     9+add_library(bitcoin-tidy SHARED bitcoin-tidy.cpp logprintf.cpp)
    10 target_include_directories(bitcoin-tidy SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS})
    11
    12 # Disable RTTI and exceptions as necessary
    

    For 2, I must admit I haven’t really looked into what the magic is doing so there’s a good chance I didn’t get it hooked up correctly. I’m guessing the objects need to reference each-other to keep symbols from being optimized out. Upstream LLVM seems kinda inconsistent about how they use the anchors, but I think this one would be a good one to follow:

    Could you please try:

     0diff --git a/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp b/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp
     1index 0f34d37793..ec89590aa8 100644
     2--- a/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp
     3+++ b/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp
     4@@ -19,4 +19,4 @@ public:
     5 static clang::tidy::ClangTidyModuleRegistry::Add<BitcoinModule>
     6     X("bitcoin-module", "Adds bitcoin checks.");
     7
     8-volatile int BitcoinModuleAnchorSource = 0;
     9+extern volatile int BitcoinModuleAnchorSource;
    10diff --git a/contrib/devtools/bitcoin-tidy/logprintf.cpp b/contrib/devtools/bitcoin-tidy/logprintf.cpp
    11index 1690c8fde0..b79e6f1486 100644
    12--- a/contrib/devtools/bitcoin-tidy/logprintf.cpp
    13+++ b/contrib/devtools/bitcoin-tidy/logprintf.cpp
    14@@ -60,3 +60,5 @@ void LogPrintfCheck::check(const clang::ast_matchers::MatchFinder::MatchResult&
    15 }
    16
    17 } // namespace bitcoin
    18+
    19+int BitcoinModuleAnchorSource = 0;
    

    jonatack commented at 4:01 pm on August 10, 2023:

    Thank you @fanquake and @theuni. I thought I was using clang/llvm from homebrew (and have export PATH="/opt/homebrew/opt/llvm/bin:$PATH" in .zshrc) but could be missing something (edit: and the cmake output below prints AppleClang 14). Tried 1. and 2. above and still see Undefined symbols for architecture arm64 at the second step.

      0jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ clang --version  
      1Homebrew clang version 16.0.6
      2Target: arm64-apple-darwin22.6.0
      3Thread model: posix
      4InstalledDir: /opt/homebrew/opt/llvm/bin
      5
      6jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ which clang      
      7/opt/homebrew/opt/llvm/bin/clang
      8
      9jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ rm -rf build
     10
     11jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake -S . -B build -DLLVM_DIR=$(llvm-config --cmakedir) -DCMAKE_BUILD_TYPE=Release
     12-- The C compiler identification is AppleClang 14.0.3.14030022
     13-- The CXX compiler identification is AppleClang 14.0.3.14030022
     14-- Detecting C compiler ABI info
     15-- Detecting C compiler ABI info - done
     16-- Check for working C compiler: /opt/homebrew/opt/ccache/libexec/cc - skipped
     17-- Detecting C compile features
     18-- Detecting C compile features - done
     19-- Detecting CXX compiler ABI info
     20-- Detecting CXX compiler ABI info - done
     21-- Check for working CXX compiler: /opt/homebrew/opt/ccache/libexec/c++ - skipped
     22-- Detecting CXX compile features
     23-- Detecting CXX compile features - done
     24-- Performing Test HAVE_FFI_CALL
     25-- Performing Test HAVE_FFI_CALL - Success
     26-- Found FFI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libffi.tbd  
     27-- Performing Test Terminfo_LINKABLE
     28-- Performing Test Terminfo_LINKABLE - Success
     29-- Found Terminfo: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurses.tbd  
     30-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")  
     31-- Found zstd: /opt/homebrew/lib/libzstd.dylib  
     32-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd (found version "2.9.13") 
     33-- Found LLVM 16.0.6
     34-- Found clang-tidy: /opt/homebrew/Cellar/llvm/16.0.6/bin/clang-tidy
     35-- Configuring done (1.1s)
     36-- Generating done (0.0s)
     37-- Build files have been written to: /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build
     38
     39jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ make VERBOSE=1                                                                     
     40make: *** No targets specified and no makefile found.  Stop.
     41
     42jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cd build
     43
     44jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ make VERBOSE=1
     45/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -S/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy -B/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build --check-build-system CMakeFiles/Makefile.cmake 0
     46/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_progress_start /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build//CMakeFiles/progress.marks
     47/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all
     48/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/bitcoin-tidy.dir/build.make CMakeFiles/bitcoin-tidy.dir/depend
     49cd /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build && /opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_depends "Unix Makefiles" /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles/bitcoin-tidy.dir/DependInfo.cmake "--color="
     50/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/bitcoin-tidy.dir/build.make CMakeFiles/bitcoin-tidy.dir/build
     51[ 33%] Building CXX object CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o
     52/opt/homebrew/opt/ccache/libexec/c++ -Dbitcoin_tidy_EXPORTS -isystem /opt/homebrew/Cellar/llvm/16.0.6/include -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -fPIC -fno-rtti -fno-exceptions -Wall -Wextra -MD -MT CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o -MF CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o.d -o CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o -c /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp
     53[ 66%] Building CXX object CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o
     54/opt/homebrew/opt/ccache/libexec/c++ -Dbitcoin_tidy_EXPORTS -isystem /opt/homebrew/Cellar/llvm/16.0.6/include -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -fPIC -fno-rtti -fno-exceptions -Wall -Wextra -MD -MT CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o -MF CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o.d -o CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o -c /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp
     55/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Finder' [-Wunused-parameter]
     56AST_MATCHER(clang::StringLiteral, unterminated)
     57^
     58/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:112:56: note: expanded from macro 'AST_MATCHER'
     59      ::clang::ast_matchers::internal::ASTMatchFinder *Finder,                 \
     60                                                       ^
     61/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Builder' [-Wunused-parameter]
     62/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:113:63: note: expanded from macro 'AST_MATCHER'
     63      ::clang::ast_matchers::internal::BoundNodesTreeBuilder *Builder) const
     64                                                              ^
     652 warnings generated.
     66[100%] Linking CXX shared module libbitcoin-tidy.so
     67/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_link_script CMakeFiles/bitcoin-tidy.dir/link.txt --verbose=1
     68/opt/homebrew/opt/ccache/libexec/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -bundle -Wl,-headerpad_max_install_names -o libbitcoin-tidy.so "CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o" "CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o" 
     69Undefined symbols for architecture arm64:
     70  "llvm::SmallVectorBase<unsigned int>::mallocForGrow(void*, unsigned long, unsigned long, unsigned long&)", referenced from:
     71      llvm::SmallVectorTemplateBase<clang::FixItHint, false>::reserveForParamAndGetAddress(clang::FixItHint const&, unsigned long) in logprintf.cpp.o
     72  "llvm::DisableABIBreakingChecks", referenced from:
     73      llvm::VerifyDisableABIBreakingChecks in bitcoin-tidy.cpp.o
     74      llvm::VerifyDisableABIBreakingChecks in logprintf.cpp.o
     75  "llvm::Registry<clang::tidy::ClangTidyModule>::add_node(llvm::Registry<clang::tidy::ClangTidyModule>::node*)", referenced from:
     76      __GLOBAL__sub_I_bitcoin_tidy.cpp in bitcoin-tidy.cpp.o
     77  "clang::ASTNodeKind::getFromNode(clang::Decl const&)", referenced from:
     78      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     79      clang::ast_matchers::internal::HasDeclarationMatcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     80  "clang::ASTNodeKind::getFromNode(clang::Stmt const&)", referenced from:
     81      clang::ast_matchers::internal::matcher_thisPointerType0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     82      clang::ast_matchers::internal::matcher_onImplicitObjectArgument0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     83      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     84      clang::ast_matchers::internal::matcher_callee1Matcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     85      clang::ast_matchers::internal::matcher_callee1Matcher<clang::CXXMemberCallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     86      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CXXMemberCallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     87  "clang::ast_matchers::MatchFinder::addMatcher(clang::ast_matchers::internal::Matcher<clang::Stmt> const&, clang::ast_matchers::MatchFinder::MatchCallback*)", referenced from:
     88      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
     89  "clang::ast_matchers::MatchFinder::MatchCallback::~MatchCallback()", referenced from:
     90      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
     91      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
     92  "clang::ast_matchers::cxxMemberCallExpr", referenced from:
     93      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
     94  "clang::ast_matchers::anyOf", referenced from:
     95      clang::ast_matchers::internal::matcher_thisPointerType0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
     96  "clang::ast_matchers::callExpr", referenced from:
     97      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
     98  "clang::ast_matchers::internal::HasNameMatcher::HasNameMatcher(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>)", referenced from:
     99      clang::ast_matchers::hasName(llvm::StringRef) in logprintf.cpp.o
    100  "clang::ast_matchers::internal::DynTypedMatcher::trueMatcher(clang::ASTNodeKind)", referenced from:
    101      clang::ast_matchers::internal::BindableMatcher<clang::QualType> clang::ast_matchers::internal::makeAllOfComposite<clang::QualType>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::QualType> const*>) in logprintf.cpp.o
    102      clang::ast_matchers::internal::BindableMatcher<clang::CXXRecordDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXRecordDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXRecordDecl> const*>) in logprintf.cpp.o
    103      clang::ast_matchers::internal::BindableMatcher<clang::FunctionDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::FunctionDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::FunctionDecl> const*>) in logprintf.cpp.o
    104      clang::ast_matchers::internal::BindableMatcher<clang::StringLiteral> clang::ast_matchers::internal::makeAllOfComposite<clang::StringLiteral>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::StringLiteral> const*>) in logprintf.cpp.o
    105      clang::ast_matchers::internal::BindableMatcher<clang::CallExpr> clang::ast_matchers::internal::makeAllOfComposite<clang::CallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CallExpr> const*>) in logprintf.cpp.o
    106      clang::ast_matchers::internal::BindableMatcher<clang::CXXMethodDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXMethodDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMethodDecl> const*>) in logprintf.cpp.o
    107      clang::ast_matchers::internal::BindableMatcher<clang::CXXMemberCallExpr> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXMemberCallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr> const*>) in logprintf.cpp.o
    108      ...
    109  "clang::ast_matchers::internal::DynTypedMatcher::constructVariadic(clang::ast_matchers::internal::DynTypedMatcher::VariadicOperator, clang::ASTNodeKind, std::__1::vector<clang::ast_matchers::internal::DynTypedMatcher, std::__1::allocator<clang::ast_matchers::internal::DynTypedMatcher>>)", referenced from:
    110      clang::ast_matchers::internal::VariadicOperatorMatcher<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>>::operator clang::ast_matchers::internal::Matcher<clang::Expr><clang::Expr>() && in logprintf.cpp.o
    111      clang::ast_matchers::internal::BindableMatcher<clang::QualType> clang::ast_matchers::internal::makeAllOfComposite<clang::QualType>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::QualType> const*>) in logprintf.cpp.o
    112      clang::ast_matchers::internal::BindableMatcher<clang::CXXRecordDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXRecordDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXRecordDecl> const*>) in logprintf.cpp.o
    113      clang::ast_matchers::internal::BindableMatcher<clang::FunctionDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::FunctionDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::FunctionDecl> const*>) in logprintf.cpp.o
    114      clang::ast_matchers::internal::BindableMatcher<clang::StringLiteral> clang::ast_matchers::internal::makeAllOfComposite<clang::StringLiteral>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::StringLiteral> const*>) in logprintf.cpp.o
    115      clang::ast_matchers::internal::BindableMatcher<clang::CallExpr> clang::ast_matchers::internal::makeAllOfComposite<clang::CallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CallExpr> const*>) in logprintf.cpp.o
    116      clang::ast_matchers::internal::BindableMatcher<clang::CXXMethodDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXMethodDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMethodDecl> const*>) in logprintf.cpp.o
    117      ...
    118  "clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool)", referenced from:
    119      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
    120  "clang::Expr::IgnoreParenImpCasts()", referenced from:
    121      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    122      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CXXMemberCallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    123  "clang::Expr::getReferencedDeclOfCallee()", referenced from:
    124      clang::ast_matchers::internal::HasDeclarationMatcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    125  "clang::tidy::ClangTidyCheck::run(clang::ast_matchers::MatchFinder::MatchResult const&)", referenced from:
    126      vtable for bitcoin::LogPrintfCheck in logprintf.cpp.o
    127  "clang::tidy::ClangTidyCheck::diag(clang::SourceLocation, llvm::StringRef, clang::DiagnosticIDs::Level)", referenced from:
    128      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
    129  "clang::tidy::ClangTidyCheck::ClangTidyCheck(llvm::StringRef, clang::tidy::ClangTidyContext*)", referenced from:
    130      std::__1::__function::__func<void clang::tidy::ClangTidyCheckFactories::registerCheck<bitcoin::LogPrintfCheck>(llvm::StringRef)::'lambda'(llvm::StringRef, clang::tidy::ClangTidyContext*), std::__1::allocator<void clang::tidy::ClangTidyCheckFactories::registerCheck<bitcoin::LogPrintfCheck>(llvm::StringRef)::'lambda'(llvm::StringRef, clang::tidy::ClangTidyContext*)>, std::__1::unique_ptr<clang::tidy::ClangTidyCheck, std::__1::default_delete<clang::tidy::ClangTidyCheck>> (llvm::StringRef, clang::tidy::ClangTidyContext*)>::operator()(llvm::StringRef&&, clang::tidy::ClangTidyContext*&&) in bitcoin-tidy.cpp.o
    131  "clang::tidy::ClangTidyModule::getModuleOptions()", referenced from:
    132      vtable for BitcoinModule in bitcoin-tidy.cpp.o
    133  "clang::tidy::ClangTidyCheckFactories::registerCheckFactory(llvm::StringRef, std::__1::function<std::__1::unique_ptr<clang::tidy::ClangTidyCheck, std::__1::default_delete<clang::tidy::ClangTidyCheck>> (llvm::StringRef, clang::tidy::ClangTidyContext*)>)", referenced from:
    134      BitcoinModule::addCheckFactories(clang::tidy::ClangTidyCheckFactories&) in bitcoin-tidy.cpp.o
    135  "clang::ASTNodeKind::isBaseOf(clang::ASTNodeKind, unsigned int*) const", referenced from:
    136      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
    137  "clang::TemplateName::getAsTemplateDecl() const", referenced from:
    138      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    139  "clang::ast_matchers::MatchFinder::MatchCallback::getCheckTraversalKind() const", referenced from:
    140      vtable for bitcoin::LogPrintfCheck in logprintf.cpp.o
    141  "clang::ast_matchers::internal::ASTMatchFinder::isTraversalIgnoringImplicitNodes() const", referenced from:
    142      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    143      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    144      clang::ast_matchers::internal::HasDeclarationMatcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    145      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CXXMemberCallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    146  "clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const", referenced from:
    147      clang::ast_matchers::internal::matcher_thisPointerType0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    148      clang::ast_matchers::internal::matcher_onImplicitObjectArgument0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    149      clang::ast_matchers::internal::matcher_pointsTo0Matcher::matches(clang::QualType const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    150      clang::ast_matchers::internal::matcher_hasType0Matcher<clang::Expr, clang::ast_matchers::internal::Matcher<clang::QualType>>::matches(clang::Expr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    151      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    152      clang::ast_matchers::internal::matcher_hasArgument0Matcher<clang::CallExpr, unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    153      clang::ast_matchers::internal::matcher_callee1Matcher<clang::CallExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::CallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    154      ...
    155  "clang::ast_matchers::internal::DynTypedMatcher::tryBind(llvm::StringRef) const", referenced from:
    156      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
    157  "clang::ast_matchers::internal::DynTypedMatcher::dynCastTo(clang::ASTNodeKind) const", referenced from:
    158      bitcoin::LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder*) in logprintf.cpp.o
    159      clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::VariadicFunction<clang::ast_matchers::internal::BindableMatcher<clang::Stmt>, clang::ast_matchers::internal::Matcher<clang::CallExpr>, &clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::makeDynCastAllOfComposite<clang::Stmt, clang::CallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CallExpr> const*>)>::operator()<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>>(clang::ast_matchers::internal::Matcher<clang::CallExpr> const&, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>> const&) const in logprintf.cpp.o
    160      clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::VariadicFunction<clang::ast_matchers::internal::BindableMatcher<clang::Stmt>, clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr>, &clang::ast_matchers::internal::BindableMatcher<clang::Stmt> clang::ast_matchers::internal::makeDynCastAllOfComposite<clang::Stmt, clang::CXXMemberCallExpr>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr> const*>)>::operator()<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_callee1Matcher, void (clang::ast_matchers::internal::TypeList<clang::ObjCMessageExpr, clang::CallExpr>), clang::ast_matchers::internal::Matcher<clang::Decl>>, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>>>(clang::ast_matchers::internal::Matcher<clang::CXXMemberCallExpr> const&, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_callee1Matcher, void (clang::ast_matchers::internal::TypeList<clang::ObjCMessageExpr, clang::CallExpr>), clang::ast_matchers::internal::Matcher<clang::Decl>> const&, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasArgument0Matcher, void (clang::ast_matchers::internal::TypeList<clang::CallExpr, clang::CXXConstructExpr, clang::CXXUnresolvedConstructExpr, clang::ObjCMessageExpr>), unsigned int, clang::ast_matchers::internal::Matcher<clang::Expr>> const&) const in logprintf.cpp.o
    161      clang::ast_matchers::internal::VariadicOperatorMatcher<clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>, clang::ast_matchers::internal::PolymorphicMatcher<clang::ast_matchers::internal::matcher_hasType0Matcher, void (clang::ast_matchers::internal::TypeList<clang::Expr, clang::FriendDecl, clang::TypedefNameDecl, clang::ValueDecl, clang::CXXBaseSpecifier>), clang::ast_matchers::internal::Matcher<clang::QualType>>>::operator clang::ast_matchers::internal::Matcher<clang::Expr><clang::Expr>() && in logprintf.cpp.o
    162      clang::ast_matchers::internal::BindableMatcher<clang::QualType> clang::ast_matchers::internal::makeAllOfComposite<clang::QualType>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::QualType> const*>) in logprintf.cpp.o
    163      clang::ast_matchers::internal::BindableMatcher<clang::CXXRecordDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::CXXRecordDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::CXXRecordDecl> const*>) in logprintf.cpp.o
    164      clang::ast_matchers::internal::BindableMatcher<clang::FunctionDecl> clang::ast_matchers::internal::makeAllOfComposite<clang::FunctionDecl>(llvm::ArrayRef<clang::ast_matchers::internal::Matcher<clang::FunctionDecl> const*>) in logprintf.cpp.o
    165      ...
    166  "clang::StringLiteral::getLocationOfByte(unsigned int, clang::SourceManager const&, clang::LangOptions const&, clang::TargetInfo const&, unsigned int*, unsigned int*) const", referenced from:
    167      bitcoin::LogPrintfCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) in logprintf.cpp.o
    168  "clang::CXXMemberCallExpr::getImplicitObjectArgument() const", referenced from:
    169      clang::ast_matchers::internal::matcher_onImplicitObjectArgument0Matcher::matches(clang::CXXMemberCallExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    170  "clang::ObjCInterfaceType::getDecl() const", referenced from:
    171      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    172  "clang::InjectedClassNameType::getDecl() const", referenced from:
    173      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    174  "clang::Type::getPointeeType() const", referenced from:
    175      clang::ast_matchers::internal::matcher_pointsTo0Matcher::matches(clang::QualType const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    176  "clang::Type::getUnqualifiedDesugaredType() const", referenced from:
    177      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    178  "clang::TagType::getDecl() const", referenced from:
    179      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    180  "clang::UsingType::getUnderlyingType() const", referenced from:
    181      clang::ast_matchers::internal::HasDeclarationMatcher<clang::QualType, clang::ast_matchers::internal::Matcher<clang::Decl>>::matchesSpecialized(clang::Type const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const in logprintf.cpp.o
    182  "vtable for clang::tidy::ClangTidyCheck", referenced from:
    183      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
    184      bitcoin::LogPrintfCheck::~LogPrintfCheck() in logprintf.cpp.o
    185  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
    186ld: symbol(s) not found for architecture arm64
    187clang: error: linker command failed with exit code 1 (use -v to see invocation)
    188make[2]: *** [libbitcoin-tidy.so] Error 1
    189make[1]: *** [CMakeFiles/bitcoin-tidy.dir/all] Error 2
    190make: *** [all] Error 2
    

    theuni commented at 5:58 pm on August 10, 2023:

    Ok, I think I see. I can force a similar error on Linux by adding “-Wl,-no-undefined” to the link-line.

    I’m guessing ld64 is opinionated about undefined symbols by default. And in this case we’re relying on them.

    Could you try messing with undefined symbol behavior and seeing what happens?

    /opt/homebrew/opt/ccache/libexec/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -bundle -Wl,-headerpad_max_install_names -o libbitcoin-tidy.so "CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o" "CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o" -Wl,-flat_namespace -Wl,-undefined,suppress

    That should link either way (assuming I’m correct about the problem), but that doesn’t necessarily mean it’ll work.

    (You might also try -Wl,-undefined,dynamic_lookup)


    jonatack commented at 7:12 pm on August 10, 2023:

    (Not sure I’m following your suggestions properly but this might be progress.)

     0jon|master:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ rm -rf build
     1
     2jon|master:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake -S . -B build -DLLVM_DIR=$(llvm-config --cmakedir) -DCMAKE_BUILD_TYPE=Release -Wl,-undefined,dynamic_lookup
     3-- The C compiler identification is AppleClang 14.0.3.14030022
     4-- The CXX compiler identification is AppleClang 14.0.3.14030022
     5-- Detecting C compiler ABI info
     6-- Detecting C compiler ABI info - done
     7-- Check for working C compiler: /opt/homebrew/opt/ccache/libexec/cc - skipped
     8-- Detecting C compile features
     9-- Detecting C compile features - done
    10-- Detecting CXX compiler ABI info
    11-- Detecting CXX compiler ABI info - done
    12-- Check for working CXX compiler: /opt/homebrew/opt/ccache/libexec/c++ - skipped
    13-- Detecting CXX compile features
    14-- Detecting CXX compile features - done
    15-- Performing Test HAVE_FFI_CALL
    16-- Performing Test HAVE_FFI_CALL - Success
    17-- Found FFI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libffi.tbd  
    18-- Performing Test Terminfo_LINKABLE
    19-- Performing Test Terminfo_LINKABLE - Success
    20-- Found Terminfo: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurses.tbd  
    21-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")  
    22-- Found zstd: /opt/homebrew/lib/libzstd.dylib  
    23-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd (found version "2.9.13") 
    24-- Found LLVM 16.0.6
    25-- Found clang-tidy: /opt/homebrew/Cellar/llvm/16.0.6/bin/clang-tidy
    26-- Configuring done (1.1s)
    27-- Generating done (0.0s)
    28-- Build files have been written to: /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build
    29
    30jon|master:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cd build
    31jon|master:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ make VERBOSE=1 
    32...same failing output as before...
    33
    34jon|master:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ /opt/homebrew/opt/ccache/libexec/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -bundle -Wl,-headerpad_max_install_names -o libbitcoin-tidy.so "CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o" "CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o" -Wl,-flat_namespace -Wl,-undefined,suppress
    35
    36jon|master:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ make VERBOSE=1
    37/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -S/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy -B/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build --check-build-system CMakeFiles/Makefile.cmake 0
    38/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_progress_start /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build//CMakeFiles/progress.marks
    39/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all
    40/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/bitcoin-tidy.dir/build.make CMakeFiles/bitcoin-tidy.dir/depend
    41cd /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build && /opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_depends "Unix Makefiles" /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles/bitcoin-tidy.dir/DependInfo.cmake "--color="
    42Consolidate compiler generated dependencies of target bitcoin-tidy
    43/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/bitcoin-tidy.dir/build.make CMakeFiles/bitcoin-tidy.dir/build
    44make[2]: Nothing to be done for `CMakeFiles/bitcoin-tidy.dir/build'.
    45[100%] Built target bitcoin-tidy
    46/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_progress_start /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles 0
    

    jonatack commented at 7:26 pm on August 10, 2023:
    (The above works with master and 2. above, but not with 1.)

    theuni commented at 7:27 pm on August 10, 2023:

    Yep, looks like that worked! And it seems to be correct too, turns out upstream LLVM does the same thing.

    This should be the actual fix, could you please confirm that building works with it?

     0diff --git a/contrib/devtools/bitcoin-tidy/CMakeLists.txt b/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     1index 9ed18696d4..24216f2fb0 100644
     2--- a/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     3+++ b/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     4@@ -25,6 +25,10 @@ else()
     5     target_compile_options(bitcoin-tidy PRIVATE -fno-exceptions)
     6 endif()
     7
     8+if(CMAKE_HOST_APPLE)
     9+    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
    10+endif()
    11+
    12 # Add warnings
    13 if (MSVC)
    14     target_compile_options(bitcoin-tidy PRIVATE /W4)
    

    (Making sure that this the only change, as this would conflict with some of my other suggestions for tests above)

    Now that you’ve got it building, you can see if it actually works with make bitcoin-tidy-tests.


    jonatack commented at 8:04 pm on August 10, 2023:
     0jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ rm -rf build
     1
     2jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake -S . -B build -DLLVM_DIR=$(llvm-config --cmakedir) -DCMAKE_BUILD_TYPE=Release
     3-- The C compiler identification is AppleClang 14.0.3.14030022
     4-- The CXX compiler identification is AppleClang 14.0.3.14030022
     5-- Detecting C compiler ABI info
     6-- Detecting C compiler ABI info - done
     7-- Check for working C compiler: /opt/homebrew/opt/ccache/libexec/cc - skipped
     8-- Detecting C compile features
     9-- Detecting C compile features - done
    10-- Detecting CXX compiler ABI info
    11-- Detecting CXX compiler ABI info - done
    12-- Check for working CXX compiler: /opt/homebrew/opt/ccache/libexec/c++ - skipped
    13-- Detecting CXX compile features
    14-- Detecting CXX compile features - done
    15-- Performing Test HAVE_FFI_CALL
    16-- Performing Test HAVE_FFI_CALL - Success
    17-- Found FFI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libffi.tbd  
    18-- Performing Test Terminfo_LINKABLE
    19-- Performing Test Terminfo_LINKABLE - Success
    20-- Found Terminfo: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurses.tbd  
    21-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")  
    22-- Found zstd: /opt/homebrew/lib/libzstd.dylib  
    23-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd (found version "2.9.13") 
    24-- Found LLVM 16.0.6
    25-- Found clang-tidy: /opt/homebrew/Cellar/llvm/16.0.6/bin/clang-tidy
    26-- Configuring done (1.2s)
    27-- Generating done (0.0s)
    28-- Build files have been written to: /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build
    29
    30jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build
    31[ 33%] Building CXX object CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o
    32[ 66%] Building CXX object CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o
    33/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Finder' [-Wunused-parameter]
    34AST_MATCHER(clang::StringLiteral, unterminated)
    35^
    36/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:112:56: note: expanded from macro 'AST_MATCHER'
    37      ::clang::ast_matchers::internal::ASTMatchFinder *Finder,                 \
    38                                                       ^
    39/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Builder' [-Wunused-parameter]
    40/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:113:63: note: expanded from macro 'AST_MATCHER'
    41      ::clang::ast_matchers::internal::BoundNodesTreeBuilder *Builder) const
    42                                                              ^
    432 warnings generated.
    44[100%] Linking CXX shared module libbitcoin-tidy.so
    45[100%] Built target bitcoin-tidy
    46
    47jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build --target bitcoin-tidy-tests                                    
    48[ 75%] Built target bitcoin-tidy
    49[100%] Building CXX object CMakeFiles/bitcoin-tidy-tests.dir/example_logprintf.cpp.o
    50USAGE: clang-tidy [options] <source0> [... <sourceN>]
    51
    52...list of cmake options...
    53
    54Error opening '/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/libbitcoin-tidy.dylib': dlopen(/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/libbitcoin-tidy.dylib, 0x0009): tried: '/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/libbitcoin-tidy.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/libbitcoin-tidy.dylib' (no such file), '/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/libbitcoin-tidy.dylib' (no such file)
    55  -load request ignored.
    56Error: no checks enabled.
    57make[3]: *** [CMakeFiles/bitcoin-tidy-tests.dir/example_logprintf.cpp.o] Error 1
    58make[2]: *** [CMakeFiles/bitcoin-tidy-tests.dir/all] Error 2
    59make[1]: *** [CMakeFiles/bitcoin-tidy-tests.dir/rule] Error 2
    60make: *** [bitcoin-tidy-tests] Error 2
    61
    62jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cd build
    63
    64jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ make
    65[100%] Built target bitcoin-tidy
    66
    67jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ make bitcoin-tidy-tests
    68[ 75%] Built target bitcoin-tidy
    69[100%] Building CXX object CMakeFiles/bitcoin-tidy-tests.dir/example_logprintf.cpp.o
    70USAGE: clang-tidy [options] <source0> [... <sourceN>]
    71
    72...same errors as above...
    

    theuni commented at 8:22 pm on August 10, 2023:

    Heh, we’re getting there. Thanks for your patience!

    This should get you one step further:

     0diff --git a/contrib/devtools/bitcoin-tidy/CMakeLists.txt b/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     1index 9ed18696d4..ea74b98620 100644
     2--- a/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     3+++ b/contrib/devtools/bitcoin-tidy/CMakeLists.txt
     4@@ -33,7 +33,7 @@ else()
     5     target_compile_options(bitcoin-tidy PRIVATE -Wextra)
     6 endif()
     7
     8-set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--load=${CMAKE_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}bitcoin-tidy${CMAKE_SHARED_LIBRARY_SUFFIX}" "-checks=-*,bitcoin-*")
     9+set(CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE}" "--load=${CMAKE_BINARY_DIR}/${CMAKE_SHARED_MODULE_PREFIX}bitcoin-tidy${CMAKE_SHARED_MODULE_SUFFIX}" "-checks=-*,bitcoin-*")
    10
    11 # Create a dummy library that runs clang-tidy tests as a side-effect of building
    12 add_library(bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_logprintf.cpp)
    

    theuni commented at 9:18 pm on August 10, 2023:
    Assuming this is close to working, I’ve got a branch ready to PR here: https://github.com/theuni/bitcoin/tree/bitcoin-tidy-macos

    jonatack commented at 9:32 pm on August 10, 2023:

    Happy to be learning a little about cmake by doing 😄

    Using your branch, with the updated doc here:

     0jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake -S . -B build
     1-DLLVM_DIR=$(llvm-config --cmakedir) -DCMAKE_BUILD_TYPE=Release
     2-- The C compiler identification is AppleClang 14.0.3.14030022
     3-- The CXX compiler identification is AppleClang 14.0.3.14030022
     4-- Detecting C compiler ABI info
     5-- Detecting C compiler ABI info - done
     6-- Check for working C compiler: /opt/homebrew/opt/ccache/libexec/cc - skipped
     7-- Detecting C compile features
     8-- Detecting C compile features - done
     9-- Detecting CXX compiler ABI info
    10-- Detecting CXX compiler ABI info - done
    11-- Check for working CXX compiler: /opt/homebrew/opt/ccache/libexec/c++ - skipped
    12-- Detecting CXX compile features
    13-- Detecting CXX compile features - done
    14-- Performing Test HAVE_FFI_CALL
    15-- Performing Test HAVE_FFI_CALL - Success
    16-- Found FFI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libffi.tbd  
    17-- Performing Test Terminfo_LINKABLE
    18-- Performing Test Terminfo_LINKABLE - Success
    19-- Found Terminfo: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libcurses.tbd  
    20-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libz.tbd (found version "1.2.11")  
    21-- Found zstd: /opt/homebrew/lib/libzstd.dylib  
    22-- Found LibXml2: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libxml2.tbd (found version "2.9.13") 
    23-- Found LLVM 16.0.6
    24-- Found clang-tidy: /opt/homebrew/Cellar/llvm/16.0.6/bin/clang-tidy
    25-- Configuring done (1.4s)
    26-- Generating done (0.0s)
    27-- Build files have been written to: /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build
    28
    29jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build
    30[ 33%] Building CXX object CMakeFiles/bitcoin-tidy.dir/bitcoin-tidy.cpp.o
    31[ 66%] Building CXX object CMakeFiles/bitcoin-tidy.dir/logprintf.cpp.o
    32/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Finder' [-Wunused-parameter]
    33AST_MATCHER(clang::StringLiteral, unterminated)
    34^
    35/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:112:56: note: expanded from macro 'AST_MATCHER'
    36      ::clang::ast_matchers::internal::ASTMatchFinder *Finder,                 \
    37                                                       ^
    38/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/logprintf.cpp:12:1: warning: unused parameter 'Builder' [-Wunused-parameter]
    39/opt/homebrew/Cellar/llvm/16.0.6/include/clang/ASTMatchers/ASTMatchersMacros.h:113:63: note: expanded from macro 'AST_MATCHER'
    40      ::clang::ast_matchers::internal::BoundNodesTreeBuilder *Builder) const
    41                                                              ^
    422 warnings generated.
    43[100%] Linking CXX shared module libbitcoin-tidy.so
    44[100%] Built target bitcoin-tidy
    45
    46jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cmake --build build --target bitcoin-tidy-tests  
    47[ 75%] Built target bitcoin-tidy
    48[100%] Building CXX object CMakeFiles/bitcoin-tidy-tests.dir/example_logprintf.cpp.o
    49/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:65:15: warning: Unterminated format string used with LogPrintf [bitcoin-unterminated-logprintf]
    50    LogPrintf("hello world!");
    51              ^
    52                           \n
    53/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:22:68: note: expanded from macro 'LogPrintf'
    54#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__)
    55                                                                   ^
    56/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:21:104: note: expanded from macro 'LogPrintLevel_'
    57#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
    58                                                                                                       ^
    59/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:69:15: warning: Unterminated format string used with LogPrintf [bitcoin-unterminated-logprintf]
    60    LogPrintf("");
    61              ^
    62               \n
    63/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:22:68: note: expanded from macro 'LogPrintf'
    64#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__)
    65                                                                   ^
    66/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:21:104: note: expanded from macro 'LogPrintLevel_'
    67#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
    68                                                                                                       ^
    69/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:74:15: warning: Unterminated format string used with LogPrintf [bitcoin-unterminated-logprintf]
    70    LogPrintf("hello world!...");
    71              ^
    72                              \n
    73/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:22:68: note: expanded from macro 'LogPrintf'
    74#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__)
    75                                                                   ^
    76/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/example_logprintf.cpp:21:104: note: expanded from macro 'LogPrintLevel_'
    77#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
    78                                                                                                       ^
    79[100%] Built target bitcoin-tidy-tests
    
    0jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy$ cd build
    1
    2jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ make
    3[100%] Built target bitcoin-tidy
    4
    5jon|master =:~/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build$ make bitcoin-tidy-tests
    6[ 75%] Built target bitcoin-tidy
    7[100%] Built target bitcoin-tidy-tests
    
    0$ make VERBOSE=1         
    1/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -S/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy -B/Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build --check-build-system CMakeFiles/Makefile.cmake 0
    2/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_progress_start /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build//CMakeFiles/progress.marks
    3/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all
    4/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/bitcoin-tidy.dir/build.make CMakeFiles/bitcoin-tidy.dir/depend
    5cd /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build && /opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_depends "Unix Makefiles" /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles/bitcoin-tidy.dir/DependInfo.cmake "--color="
    6/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/bitcoin-tidy.dir/build.make CMakeFiles/bitcoin-tidy.dir/build
    7make[2]: Nothing to be done for `CMakeFiles/bitcoin-tidy.dir/build'.
    8[100%] Built target bitcoin-tidy
    9/opt/homebrew/Cellar/cmake/3.27.1/bin/cmake -E cmake_progress_start /Users/jon/bitcoin/bitcoin/contrib/devtools/bitcoin-tidy/build/CMakeFiles 0
    

    theuni commented at 11:17 pm on August 10, 2023:

    Woohoo! I’ll PR that commit.

    Thanks again for testing, glad to see it’s working on macOS (and arm64 even).

  8. doc: use llvm-config for bitcoin-tidy example
    An LLVM installation will have `llvm-config` available to query for
    info. Ask it for the `--cmakedir`, and use that in our bitcoin-tidy
    example, rather than listing multiple different (potential) paths per
    distro/OS etc.
    d82bb90a5b
  9. fanquake force-pushed on Aug 10, 2023
  10. fanquake commented at 10:41 am on August 10, 2023: member
    Simplifed this further, given we can actually just ask for llvm-config --cmakedir.
  11. TheCharlatan approved
  12. TheCharlatan commented at 12:20 pm on August 10, 2023: contributor
    Nice, Re-ACK d82bb90a5b9dc1fd48b10514bdcd8f425aced256
  13. theuni commented at 7:54 pm on August 10, 2023: member

    Nit: stale description. @jonatack’s issue is valid but unrelated. I’ll PR a fix for that separately once we have it nailed down.

    ACK d82bb90a5b9dc1fd48b10514bdcd8f425aced256.

  14. DrahtBot removed review request from theuni on Aug 10, 2023
  15. jonatack commented at 8:09 pm on August 10, 2023: contributor

    ACK d82bb90a5b9dc1fd48b10514bdcd8f425aced256

    Tested the updated steps are working in #28245 (review).

  16. fanquake commented at 9:35 am on August 11, 2023: member

    Nit: stale description.

    Updated the description.

  17. fanquake merged this on Aug 11, 2023
  18. fanquake closed this on Aug 11, 2023

  19. fanquake deleted the branch on Aug 11, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-03 10:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me