[Lldb-commits] [lldb] r291555 - [cmake] Fix LLVM_LINK_LLVM_DYLIB build, again

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 10 01:40:38 PST 2017

Author: labath
Date: Tue Jan 10 03:40:38 2017
New Revision: 291555

URL: http://llvm.org/viewvc/llvm-project?rev=291555&view=rev
[cmake] Fix LLVM_LINK_LLVM_DYLIB build, again

The llvm_config hack for lldb-server is only necessary for !DYLIB builds, as
otherwise we would get unresolved symbols from lldb libraries which do not track
their dependencies correctly (all of them). In a DYLIB build, the so will
already be added to the link dependencies and we can use that to resolve all
missing symbols.

The proper fix for this would be to have each lldb library track its
dependencies correctly.


Modified: lldb/trunk/tools/lldb-server/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/CMakeLists.txt?rev=291555&r1=291554&r2=291555&view=diff
--- lldb/trunk/tools/lldb-server/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-server/CMakeLists.txt Tue Jan 10 03:40:38 2017
@@ -183,7 +183,13 @@ else()
   target_link_libraries(lldb-server ${LLDB_USED_LIBS})
   target_link_libraries(lldb-server ${CLANG_USED_LIBS})
-llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
+  # This is necessary in !LLVM_LINK_LLVM_DYLIB as LLDB's libs do not track their
+  # dependencies properly. It is conditional because in a LLVM_LINK_LLVM_DYLIB
+  # build it would introduce duplicate symbols (add_lldb_tool links to libLLVM,
+  # and this would add the individual .a files as well).
+  llvm_config(lldb-server ${LLVM_LINK_COMPONENTS})
 target_link_libraries(lldb-server ${LLDB_SYSTEM_LIBS})

More information about the lldb-commits mailing list