Skip to content

[clang-tidy] Fix linking regression in clangTidyLLVMModule #150769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2025

Conversation

mgorny
Copy link
Member

@mgorny mgorny commented Jul 26, 2025

Fix the regression introduced in #149148 that incorrectly explicitly linked clangTransformer when dylib was used. As a result, the executables linking to clangTidyLLVMModule would end up linking both the dylib and a number of static clang libraries, leading to complete mayhem and undecipherable segmentation faults.

Fix the regression introduced in llvm#149148 that incorrectly explicitly
linked `clangTransformer` when dylib was used.  As a result,
the executables linking to `clangTidyLLVMModule` would end up linking
both the dylib and a number of static clang libraries, leading to
complete mayhem and undecipherable segmentation faults.

Signed-off-by: Michał Górny <[email protected]>
@llvmbot
Copy link
Member

llvmbot commented Jul 26, 2025

@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-clang-tidy

Author: Michał Górny (mgorny)

Changes

Fix the regression introduced in #149148 that incorrectly explicitly linked clangTransformer when dylib was used. As a result, the executables linking to clangTidyLLVMModule would end up linking both the dylib and a number of static clang libraries, leading to complete mayhem and undecipherable segmentation faults.


Full diff: https://github.com/llvm/llvm-project/pull/150769.diff

1 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/llvm/CMakeLists.txt (+1-1)
diff --git a/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt b/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt
index 4f1da43d3f1b7..41386cdb55b1f 100644
--- a/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/llvm/CMakeLists.txt
@@ -17,7 +17,6 @@ add_clang_library(clangTidyLLVMModule STATIC
   clangTidy
   clangTidyReadabilityModule
   clangTidyUtils
-  clangTransformer
 
   DEPENDS
   omp_gen
@@ -31,4 +30,5 @@ clang_target_link_libraries(clangTidyLLVMModule
   clangBasic
   clangLex
   clangTooling
+  clangTransformer
   )

@mgorny
Copy link
Member Author

mgorny commented Jul 26, 2025

Thanks!

@mgorny mgorny merged commit fa79c23 into llvm:main Jul 26, 2025
12 checks passed
@mgorny mgorny deleted the clang-tidy-link branch July 26, 2025 15:22
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
Fix the regression introduced in llvm#149148 that incorrectly explicitly
linked `clangTransformer` when dylib was used. As a result, the
executables linking to `clangTidyLLVMModule` would end up linking both
the dylib and a number of static clang libraries, leading to complete
mayhem and undecipherable segmentation faults.

Signed-off-by: Michał Górny <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants