Use accept4 workaround for MIPS Android build.

Summary: Similar to http://reviews.llvm.org/rL242319, which was for ARM.

Reviewers: chying, ovyalov

Subscribers: aemerson, tberghammer, danalbert, srhines, lldb-commits

Differential Revision: http://reviews.llvm.org/D14127

llvm-svn: 251439
This commit is contained in:
Chaoren Lin 2015-10-27 19:17:35 +00:00
parent c9879ecfbc
commit 339428232a
2 changed files with 7 additions and 3 deletions

View File

@ -115,6 +115,10 @@ elseif( ANDROID_ABI STREQUAL "mips" )
list( APPEND LLDB_SYSTEM_LIBS atomic )
set( LLDB_SYSTEM_LIBS ${LLDB_SYSTEM_LIBS} CACHE INTERNAL "" FORCE )
endif()
if( LLVM_BUILD_STATIC )
# Temporary workaround for static linking with the latest API.
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -DANDROID_MIPS_BUILD_STATIC" )
endif()
endif()
if( NOT LLVM_BUILD_STATIC )

View File

@ -40,11 +40,11 @@
#include <asm-generic/errno-base.h>
#include <errno.h>
#include <arpa/inet.h>
#if defined(ANDROID_ARM_BUILD_STATIC)
#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC)
#include <unistd.h>
#include <sys/syscall.h>
#include <fcntl.h>
#endif // ANDROID_ARM_BUILD_STATIC
#endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC
#endif // __ANDROID_NDK__
using namespace lldb;
@ -457,7 +457,7 @@ Socket::AcceptSocket(NativeSocket sockfd,
Error& error)
{
error.Clear();
#if defined(ANDROID_ARM_BUILD_STATIC)
#if defined(ANDROID_ARM_BUILD_STATIC) || defined(ANDROID_MIPS_BUILD_STATIC)
// Temporary workaround for statically linking Android lldb-server with the
// latest API.
int fd = syscall(__NR_accept, sockfd, addr, addrlen);