[PATCH] D111100: enable plugins for clang-tidy

Cristian Adam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 8 04:34:20 PST 2022


cristian.adam requested changes to this revision.
cristian.adam added a comment.

I had on Windows two uses cases that failed due to this patch.

1. MSVC2019 with `-D LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON`

  FAILED: bin/CTTestTidyModule.dll 
  cmd.exe /C "cd . && C:\tools\cmake\bin\cmake.exe -E vs_link_dll --intdir=tools\clang\tools\extra\test\CMakeFiles\CTTestTidyModule.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo tools\clang\tools\extra\test\CMakeFiles\CTTestTidyModule.dir\clang-tidy\CTTestTidyModule.cpp.obj  /out:bin\CTTestTidyModule.dll /implib:lib\CTTestTidyModule.lib /pdb:bin\CTTestTidyModule.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO  lib\clang-tidy.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
  LINK: command "C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo tools\clang\tools\extra\test\CMakeFiles\CTTestTidyModule.dir\clang-tidy\CTTestTidyModule.cpp.obj /out:bin\CTTestTidyModule.dll /implib:lib\CTTestTidyModule.lib /pdb:bin\CTTestTidyModule.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO lib\clang-tidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:bin\CTTestTidyModule.dll.manifest" failed (exit code 1120) with the following output:
  CTTestTidyModule.cpp.obj : error LNK2001: unresolved external symbol "class clang::ast_matchers::internal::VariadicDynCastAllOfMatcher<class clang::Decl,class clang::TranslationUnitDecl> const clang::ast_matchers::translationUnitDecl" (?translationUnitDecl at ast_matchers@clang@@3V?$VariadicDynCastAllOfMatcher at VDecl@clang@@VTranslationUnitDecl at 2@@internal at 12@B)
  bin\CTTestTidyModule.dll : fatal error LNK1120: 1 unresolved externals



2. MinGW 11.2.0 with `-D LLVM_BUILD_LLVM_DYLIB=ON` `-D LLVM_LINK_LLVM_DYLIB=ON` `-D CLANG_LINK_CLANG_DYLIB=ON`

  FAILED: bin/CTTestTidyModule.dll 
  cmd.exe /C "cd . && C:\mingw64\bin\g++.exe -Wa,-mbig-obj -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing  -O2 -DNDEBUG  -Wl,--gc-sections -shared -o bin\CTTestTidyModule.dll -Wl,--major-image-version,0,--minor-image-version,0 tools/clang/tools/extra/test/CMakeFiles/CTTestTidyModule.dir/clang-tidy/CTTestTidyModule.cpp.obj  lib/libLLVM-14.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
  C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tools/clang/tools/extra/test/CMakeFiles/CTTestTidyModule.dir/clang-tidy/CTTestTidyModule.cpp.obj:CTTestTidyModule.cpp:(.text$_ZNK5clang12ast_matchers8internal30matcher_hasDecayedType0Matcher7matchesERKNS_11DecayedTypeEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE[_ZNK5clang12ast_matchers8internal30matcher_hasDecayedType0Matcher7matchesERKNS_11DecayedTypeEPNS1_14ASTMatchFinderEPNS1_21BoundNodesTreeBuilderE]+0x1f): undefined reference to `clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const'
  ...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111100/new/

https://reviews.llvm.org/D111100



More information about the cfe-commits mailing list