forked from OSchip/llvm-project
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:
parent
0e57b13743
commit
059e5fb44f
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue