[Lldb-commits] [lldb] r242716 - [Android] Only enable evil libdl.a hack when building statically.
Chaoren Lin
chaorenl at google.com
Mon Jul 20 14:46:20 PDT 2015
Author: chaoren
Date: Mon Jul 20 16:46:20 2015
New Revision: 242716
URL: http://llvm.org/viewvc/llvm-project?rev=242716&view=rev
Log:
[Android] Only enable evil libdl.a hack when building statically.
Modified:
lldb/trunk/cmake/platforms/Android.cmake
Modified: lldb/trunk/cmake/platforms/Android.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/platforms/Android.cmake?rev=242716&r1=242715&r2=242716&view=diff
==============================================================================
--- lldb/trunk/cmake/platforms/Android.cmake (original)
+++ lldb/trunk/cmake/platforms/Android.cmake Mon Jul 20 16:46:20 2015
@@ -125,17 +125,19 @@ set( ANDROID_LINKER_FLAGS "${ANDROID_LIN
# 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.
-set( ANDROID_LIBDL_STUB "${CMAKE_BINARY_DIR}/libdl_stub" )
-file( MAKE_DIRECTORY ${ANDROID_LIBDL_STUB} )
-file( WRITE "${ANDROID_LIBDL_STUB}/libdl.c" "
+if( LLVM_BUILD_STATIC )
+ set( ANDROID_LIBDL_STUB "${CMAKE_BINARY_DIR}/libdl_stub" )
+ file( MAKE_DIRECTORY ${ANDROID_LIBDL_STUB} )
+ file( WRITE "${ANDROID_LIBDL_STUB}/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; }")
-execute_process( COMMAND ${CMAKE_C_COMPILER} -c ${ANDROID_LIBDL_STUB}/libdl.c -o ${ANDROID_LIBDL_STUB}/libdl.o )
-execute_process( COMMAND ${CMAKE_AR} rcs ${ANDROID_LIBDL_STUB}/libdl.a ${ANDROID_LIBDL_STUB}/libdl.o )
-set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -L${ANDROID_LIBDL_STUB}" )
+ execute_process( COMMAND ${CMAKE_C_COMPILER} -c ${ANDROID_LIBDL_STUB}/libdl.c -o ${ANDROID_LIBDL_STUB}/libdl.o )
+ execute_process( COMMAND ${CMAKE_AR} rcs ${ANDROID_LIBDL_STUB}/libdl.a ${ANDROID_LIBDL_STUB}/libdl.o )
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -L${ANDROID_LIBDL_STUB}" )
+endif()
################# END EVIL HACK ##################
# cache flags
More information about the lldb-commits
mailing list