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
This commit is contained in:
Tamas Berghammer 2016-05-20 10:58:55 +00:00
parent 0e57b13743
commit 059e5fb44f
1 changed files with 11 additions and 1 deletions

View File

@ -164,6 +164,15 @@ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
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).
@ -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 )