[PATCH] D81921: [llvm] Avoid linking llvm-cfi-verify to duplicate libs

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 03:50:09 PDT 2020


mgorny created this revision.
mgorny added reviewers: vlad.tsyrklevich, hctim, mstorsjo.
Herald added a project: LLVM.

Fix the CMake rules for LLVMCFIVerify library not to pull duplicate
LLVM .a libraries when linking to the dylib.  This prevents problems
due to duplicate symbols and apparently fixes mingw32.

This is an alternative approach to D44650 <https://reviews.llvm.org/D44650> that just forces .a libraries
instead.  However, there doesn't seem to be any reason to do that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81921

Files:
  llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt


Index: llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt
===================================================================
--- llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt
+++ llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt
@@ -7,13 +7,17 @@
   )
 
 llvm_update_compile_flags(LLVMCFIVerify)
-llvm_map_components_to_libnames(libs
-  DebugInfoDWARF
-  MC
-  MCParser
-  Object
-  Support
-  Symbolize
-  )
+if (LLVM_LINK_LLVM_DYLIB)
+  set(libs LLVM)
+else()
+  llvm_map_components_to_libnames(libs
+    DebugInfoDWARF
+    MC
+    MCParser
+    Object
+    Support
+    Symbolize
+    )
+endif()
 target_link_libraries(LLVMCFIVerify ${libs})
 set_target_properties(LLVMCFIVerify PROPERTIES FOLDER "Libraries")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81921.271016.patch
Type: text/x-patch
Size: 706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200616/1afc9212/attachment.bin>


More information about the llvm-commits mailing list