[Lldb-commits] [lldb] r242401 - Revert "Default to linking lldb-server statically for Android."

Tamas Berghammer tberghammer at google.com
Thu Jul 16 07:13:01 PDT 2015


Author: tberghammer
Date: Thu Jul 16 09:13:01 2015
New Revision: 242401

URL: http://llvm.org/viewvc/llvm-project?rev=242401&view=rev
Log:
Revert "Default to linking lldb-server statically for Android."

With static linking lldb-server crashes in platform mode when
tries to listen on localhost:5432 on the android build bot.

This reverts commit 3ea861707dec8423746679ff496e4fd03255d4cf.

Modified:
    lldb/trunk/cmake/LLDBDependencies.cmake
    lldb/trunk/cmake/platforms/Android.cmake

Modified: lldb/trunk/cmake/LLDBDependencies.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=242401&r1=242400&r2=242401&view=diff
==============================================================================
--- lldb/trunk/cmake/LLDBDependencies.cmake (original)
+++ lldb/trunk/cmake/LLDBDependencies.cmake Thu Jul 16 09:13:01 2015
@@ -155,12 +155,7 @@ endif()
 list(APPEND LLDB_SYSTEM_LIBS ${system_libs})
 
 if (LLVM_BUILD_STATIC)
-  if (NOT LLDB_DISABLE_PYTHON)
-    list(APPEND LLDB_SYSTEM_LIBS python2.7 util)
-  endif()
-  if (NOT LLDB_DISABLE_CURSES)
-    list(APPEND LLDB_SYSTEM_LIBS gpm)
-  endif()
+  list(APPEND LLDB_SYSTEM_LIBS python2.7 z util termcap gpm ssl crypto bsd)
 endif()
 
 set( LLVM_LINK_COMPONENTS

Modified: lldb/trunk/cmake/platforms/Android.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/platforms/Android.cmake?rev=242401&r1=242400&r2=242401&view=diff
==============================================================================
--- lldb/trunk/cmake/platforms/Android.cmake (original)
+++ lldb/trunk/cmake/platforms/Android.cmake Thu Jul 16 09:13:01 2015
@@ -38,15 +38,6 @@ add_definitions( -DANDROID -D__ANDROID_N
 set( ANDROID True )
 set( __ANDROID_NDK__ True )
 
-# linking lldb-server statically for Android avoids the need to ship two
-# binaries (pie for API 21+ and non-pie for API 14-). It's possible to use
-# a non-pie shim on API 14-, but that requires lldb-server to dynamically export
-# its symbols, which significantly increases the binary size. Static linking, on
-# the other hand, has little to no effect on the binary size.
-if (NOT DEFINED LLVM_BUILD_STATIC)
- set( LLVM_BUILD_STATIC True )
-endif()
-
 set( ANDROID_ABI "${ANDROID_ABI}" CACHE INTERNAL "Android Abi" FORCE )
 if( ANDROID_ABI STREQUAL "x86" )
  set( CMAKE_SYSTEM_PROCESSOR "i686" )
@@ -108,6 +99,11 @@ elseif( ANDROID_ABI STREQUAL "armeabi" )
  endif()
 endif()
 
+# PIE is required for API 21+ so we enable it
+# unfortunately, it is not supported before API 14 so we need to do something else there
+# see http://llvm.org/pr23457
+set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -pie -fPIE" )
+
 # linker flags
 set( ANDROID_CXX_FLAGS    "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections" )
 set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )





More information about the lldb-commits mailing list