summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2016-05-20 10:58:55 +0000
committerTamas Berghammer <tberghammer@google.com>2016-05-20 10:58:55 +0000
commit059e5fb44fea2e69ea74bad0b381e614f81e3e5e (patch)
tree9ad4c21964b479e0d14a9d778d6f470cbfdfd4e3
parent0e57b1374333b481b9b10b8565e05b54d821b3ca (diff)
downloadbcm5719-llvm-059e5fb44fea2e69ea74bad0b381e614f81e3e5e.tar.gz
bcm5719-llvm-059e5fb44fea2e69ea74bad0b381e614f81e3e5e.zip
Work around android-arm NDK bug exposed by rL269992
In the android-arm ndk there is a duplicated typedef in link.h and in unwind.h causing build erros. This CL introduces a HACK to prevent LLVM from finding unwind.h to fix the issue. llvm-svn: 270201
-rw-r--r--lldb/cmake/platforms/Android.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/lldb/cmake/platforms/Android.cmake b/lldb/cmake/platforms/Android.cmake
index 98b695be6ef..9aad65cbe13 100644
--- a/lldb/cmake/platforms/Android.cmake
+++ b/lldb/cmake/platforms/Android.cmake
@@ -165,6 +165,15 @@ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
################# BEGIN EVIL HACK ##################
+# In the android-arm NDK unwind.h and link.h contains 2 conflicting
+# typedef for _Unwind_Ptr. Force HAVE_UNWIND_BACKTRACE to 0 to prevent
+# LLVM from finding unwind.h what would break the build.
+if ( ANDROID_ABI STREQUAL "armeabi" )
+ 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
@@ -178,7 +187,8 @@ if( LLVM_BUILD_STATIC )
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 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 )
OpenPOWER on IntegriCloud