Skip to content

ClangTidyTests fail to link w/ shared libclang-cpp+libLLVM: undefined reference to `llvm::Annotations::Annotations(llvm::StringRef)' #48275

@llvmbot

Description

@llvmbot
Bugzilla Link 48931
Resolution FIXED
Resolved on Jan 29, 2021 22:22
Version trunk
OS Linux
Blocks #48246
Attachments sys-devel:clang-12.0.0_rc1:20210129-005431.log.xz
Reporter LLVM Bugzilla Contributor
Fixed by commit(s) 632545e 07f8d43

Extended Description

Attaching the complete build log.

The linker errors follow. I suspect it's missing proper linking to libLLVMTestingSupport, I am going to try patching it in a minute.

/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/ClangTidyOptionsTest.cpp.o: in function clang::tidy::test::ParseConfiguration_CollectDiags_Test::TestBody()': ClangTidyOptionsTest.cpp:(.text._ZN5clang4tidy4test36ParseConfiguration_CollectDiags_Test8TestBodyEv+0x62): undefined reference to llvm::Annotations::Annotations(llvm::StringRef)'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ClangTidyOptionsTest.cpp:(.text._ZN5clang4tidy4test36ParseConfiguration_CollectDiags_Test8TestBodyEv+0x24c): undefined reference to llvm::Annotations::range(llvm::StringRef) const' /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ClangTidyOptionsTest.cpp:(.text._ZN5clang4tidy4test36ParseConfiguration_CollectDiags_Test8TestBodyEv+0x263): undefined reference to llvm::Annotations::range(llvm::StringRef) const'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ClangTidyOptionsTest.cpp:(.text._ZN5clang4tidy4test36ParseConfiguration_CollectDiags_Test8TestBodyEv+0x39a): undefined reference to llvm::Annotations::Annotations(llvm::StringRef)' /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ClangTidyOptionsTest.cpp:(.text._ZN5clang4tidy4test36ParseConfiguration_CollectDiags_Test8TestBodyEv+0x88f): undefined reference to llvm::Annotations::range(llvm::StringRef) const'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ClangTidyOptionsTest.cpp:(.text._ZN5clang4tidy4test36ParseConfiguration_CollectDiags_Test8TestBodyEv+0x8a6): undefined reference to llvm::Annotations::range(llvm::StringRef) const' /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/ClangTidyOptionsTest.cpp.o: in function clang::tidy::test::(anonymous namespace)::DiagRangeMatcherPllvm::Annotations::Range::gmock_Impl<clang::tidy::test::(anonymous namespace)::DiagCollecter::Diag const&>::FormatDescription(bool) const':
ClangTidyOptionsTest.cpp:(.text._ZNK5clang4tidy4test12_GLOBAL__N_117DiagRangeMatcherPIN4llvm11Annotations5RangeEE10gmock_ImplIRKNS2_13DiagCollecter4DiagEE17FormatDescriptionEb+0xe4): undefined reference to `llvm::operator<<(llvm::raw_ostream&, llvm::Annotations::Range const&)'
collect2: error: ld returned 1 exit status

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions