[Lldb-commits] [PATCH] D26505: Remove a hack from the Android toolchain file

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 10 07:25:59 PST 2016


labath created this revision.
labath added reviewers: tberghammer, beanz.
labath added a subscriber: lldb-commits.
Herald added subscribers: mgorny, srhines, danalbert.

The fix is to make sure llvm does not pull in dlopen() in configurations where it
is not available.


https://reviews.llvm.org/D26505

Files:
  cmake/platforms/Android.cmake


Index: cmake/platforms/Android.cmake
===================================================================
--- cmake/platforms/Android.cmake
+++ cmake/platforms/Android.cmake
@@ -172,27 +172,3 @@
  set( HAVE_UNWIND_BACKTRACE 0 CACHE INTERNAL "Hack to disable the finding of unwind.h on Android arm" )
 endif()
 ################# END EVIL HACK ####################
-
-################# BEGIN EVIL HACK ##################
-# lldb-server links against libdl even though it's not being used and
-# libdl.a is currently missing from the toolchain (b.android.com/178517).
-# Therefore, in order to statically link lldb-server, we need a temporary
-# workaround. This creates a dummy libdl.a stub until the actual
-# libdl.a can be implemented in the toolchain.
-if( LLVM_BUILD_STATIC )
- set( libdl "${CMAKE_BINARY_DIR}/libdl_stub" )
- file( MAKE_DIRECTORY ${libdl} )
- file( WRITE "${libdl}/libdl.c" "
-#include <dlfcn.h>
-void *       dlopen  (const char *filename, int flag)   { return 0; }
-const char * dlerror (void)                             { return 0; }
-void *       dlsym   (void *handle, const char *symbol) { return 0; }
-int          dlclose (void *handle)                     { return 0; }
-int          dladdr  (const void *addr, Dl_info *info)  { return 0; }")
- set( flags "${CMAKE_C_FLAGS}" )
- separate_arguments( flags )
- execute_process( COMMAND ${CMAKE_C_COMPILER} ${flags} -c ${libdl}/libdl.c -o ${libdl}/libdl.o )
- execute_process( COMMAND ${CMAKE_AR} rcs ${libdl}/libdl.a ${libdl}/libdl.o )
- set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${libdl}" )
-endif()
-################# END EVIL HACK ##################


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26505.77484.patch
Type: text/x-patch
Size: 1645 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161110/b3c5f4a1/attachment.bin>


More information about the lldb-commits mailing list