summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Zemtsov <ezemtsov@google.com>2017-09-16 02:19:21 +0000
committerEugene Zemtsov <ezemtsov@google.com>2017-09-16 02:19:21 +0000
commitd4abad9a0a1f45d9c12a3a88391243431a0942c0 (patch)
tree973e2988b4633707e4bad10716f2f9973a1e9621
parent309f360240ff7f7d1c0722e18ec6a582bef0eb0e (diff)
downloadbcm5719-llvm-d4abad9a0a1f45d9c12a3a88391243431a0942c0.tar.gz
bcm5719-llvm-d4abad9a0a1f45d9c12a3a88391243431a0942c0.zip
More precise c library feature detection for Android.
llvm-svn: 313436
-rw-r--r--lldb/cmake/modules/LLDBGenerateConfig.cmake1
-rw-r--r--lldb/source/Host/common/Socket.cpp2
-rw-r--r--lldb/source/Host/posix/ProcessLauncherPosixFork.cpp2
3 files changed, 3 insertions, 2 deletions
diff --git a/lldb/cmake/modules/LLDBGenerateConfig.cmake b/lldb/cmake/modules/LLDBGenerateConfig.cmake
index 04c667e6dd4..8b2b90f7cac 100644
--- a/lldb/cmake/modules/LLDBGenerateConfig.cmake
+++ b/lldb/cmake/modules/LLDBGenerateConfig.cmake
@@ -9,6 +9,7 @@ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists(ppoll poll.h HAVE_PPOLL)
set(CMAKE_REQUIRED_DEFINITIONS)
check_symbol_exists(sigaction signal.h HAVE_SIGACTION)
+check_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
check_include_file(termios.h HAVE_TERMIOS_H)
check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
diff --git a/lldb/source/Host/common/Socket.cpp b/lldb/source/Host/common/Socket.cpp
index 5490e9b30bd..4c23e4eb560 100644
--- a/lldb/source/Host/common/Socket.cpp
+++ b/lldb/source/Host/common/Socket.cpp
@@ -450,7 +450,7 @@ NativeSocket Socket::AcceptSocket(NativeSocket sockfd, struct sockaddr *addr,
close(fd);
}
return fd;
-#elif defined(SOCK_CLOEXEC)
+#elif defined(SOCK_CLOEXEC) && defined(HAVE_ACCEPT4)
int flags = 0;
if (!child_processes_inherit) {
flags |= SOCK_CLOEXEC;
diff --git a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
index 66c0229e0da..fb235d70f8e 100644
--- a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
+++ b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
@@ -29,7 +29,7 @@
#define PT_TRACE_ME PTRACE_TRACEME
#endif
-#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 15
#include <linux/personality.h>
#elif defined(__linux__)
#include <sys/personality.h>
OpenPOWER on IntegriCloud