[Lldb-commits] [lldb] r225398 - lldb-platform - static link all llvm dependencies

Vince Harron vharron at google.com
Wed Jan 7 13:35:08 PST 2015


Author: vharron
Date: Wed Jan  7 15:35:07 2015
New Revision: 225398

URL: http://llvm.org/viewvc/llvm-project?rev=225398&view=rev
Log:
lldb-platform - static link all llvm dependencies

Differential Revision: http://reviews.llvm.org/D6797

lldb-gdbserver statically links all llvm dependencies. This allows
dead stripping code and reduces total binary size.

This change modifies lldb-plaform to static link llvm dependencies
like lldb-gdbserver.


Modified:
    lldb/trunk/cmake/LLDBDependencies.cmake
    lldb/trunk/tools/lldb-platform/CMakeLists.txt

Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=225398&r1=225397&r2=225398&view=diff
==============================================================================
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Wed Jan  7 15:35:07 2015
@@ -139,12 +139,16 @@ if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   list(APPEND LLDB_SYSTEM_LIBS execinfo)
 endif()
 
-if (NOT LLDB_DISABLE_PYTHON)
+if (NOT LLDB_DISABLE_PYTHON AND NOT LLVM_BUILD_STATIC)
   list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES})
 endif()
 
 list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
 
+if (LLVM_BUILD_STATIC)
+  list(APPEND LLDB_SYSTEM_LIBS python2.7 z util termcap gpm ssl crypto bsd)
+endif()
+
 set( LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
   interpreter

Modified: lldb/trunk/tools/lldb-platform/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-platform/CMakeLists.txt?rev=225398&r1=225397&r2=225398&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-platform/CMakeLists.txt (original)
+++ lldb/trunk/tools/lldb-platform/CMakeLists.txt Wed Jan  7 15:35:07 2015
@@ -1,12 +1,40 @@
 set(LLVM_NO_RTTI 1)
 
+if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
+include_directories(
+  ../../source/Plugins/Process/Linux
+  ../../source/Plugins/Process/POSIX
+  )
+endif ()
+
+if ( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" )
+include_directories(
+  ../../source/Plugins/Process/FreeBSD
+  ../../source/Plugins/Process/POSIX
+  )
+endif ()
+
 include_directories(../../source)
 
+include(../../cmake/LLDBDependencies.cmake)
+
 add_lldb_executable(lldb-platform
   lldb-platform.cpp
+  ../../source/lldb-log.cpp
+  ../../source/lldb.cpp
   )
 
-target_link_libraries(lldb-platform liblldb)
+# The Darwin linker doesn't understand --start-group/--end-group.
+if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
+  target_link_libraries(lldb-platform
+                        -Wl,--start-group ${LLDB_USED_LIBS} -Wl,--end-group)
+else()
+  target_link_libraries(lldb-platform ${LLDB_USED_LIBS})
+endif()
+target_link_libraries(lldb-platform ${CLANG_USED_LIBS})
+llvm_config(lldb-platform ${LLVM_LINK_COMPONENTS})
+
+target_link_libraries(lldb-platform ${LLDB_SYSTEM_LIBS})
 
 set_target_properties(lldb-platform PROPERTIES VERSION ${LLDB_VERSION})
 





More information about the lldb-commits mailing list