summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/cmake/platforms/Android.cmake2
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp32
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp30
3 files changed, 30 insertions, 34 deletions
diff --git a/lldb/cmake/platforms/Android.cmake b/lldb/cmake/platforms/Android.cmake
index 816453f6139..f0b5c7a047b 100644
--- a/lldb/cmake/platforms/Android.cmake
+++ b/lldb/cmake/platforms/Android.cmake
@@ -41,7 +41,7 @@ set( __ANDROID_NDK__ True )
set( ANDROID_ABI "${ANDROID_ABI}" CACHE INTERNAL "Android Abi" FORCE )
if( ANDROID_ABI STREQUAL "x86" )
set( CMAKE_SYSTEM_PROCESSOR "i686" )
- set( ANDROID_TOOLCHAIN_NAME "x86-linux-android" )
+ set( ANDROID_TOOLCHAIN_NAME "i686-linux-android" )
elseif( ANDROID_ABI STREQUAL "x86_64" )
set( CMAKE_SYSTEM_PROCESSOR "x86_64" )
set( ANDROID_TOOLCHAIN_NAME "x86_64-linux-android" )
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 99de1938e2e..a72b6a24063 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -17,23 +17,6 @@
#include <string.h>
#include <stdint.h>
#include <unistd.h>
-#include <linux/unistd.h>
-#if defined(__ANDROID_NDK__) && defined (__arm__)
-#include <linux/personality.h>
-#include <linux/user.h>
-#else
-#include <sys/personality.h>
-#include <sys/user.h>
-#endif
-#ifndef __ANDROID__
-#include <sys/procfs.h>
-#endif
-#include <sys/ptrace.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
#if defined (__arm64__) || defined (__aarch64__)
// NT_PRSTATUS and NT_FPREGSET definition
@@ -69,6 +52,21 @@
#include "ThreadStateCoordinator.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
+// System includes - They have to be included after framework includes because they define some
+// macros which collide with variable names in other modules
+#include <linux/unistd.h>
+#ifndef __ANDROID__
+#include <sys/procfs.h>
+#endif
+#include <sys/personality.h>
+#include <sys/ptrace.h>
+#include <sys/socket.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/user.h>
+#include <sys/wait.h>
+
#ifdef __ANDROID__
#define __ptrace_request int
#define PT_DETACH PTRACE_DETACH
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index e87e6626852..81eb4d634a7 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -16,22 +16,6 @@
#include <stdint.h>
#include <unistd.h>
#include <elf.h>
-#if defined(__ANDROID_NDK__) && defined (__arm__)
-#include <linux/personality.h>
-#include <linux/user.h>
-#else
-#include <sys/personality.h>
-#include <sys/user.h>
-#endif
-#ifndef __ANDROID__
-#include <sys/procfs.h>
-#endif
-#include <sys/ptrace.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <sys/wait.h>
// C++ Includes
// Other libraries and framework includes
@@ -52,6 +36,20 @@
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "ProcessMonitor.h"
+// System includes - They have to be included after framework includes because they define some
+// macros which collide with variable names in other modules
+#ifndef __ANDROID__
+#include <sys/procfs.h>
+#endif
+#include <sys/personality.h>
+#include <sys/ptrace.h>
+#include <sys/socket.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/user.h>
+#include <sys/wait.h>
+
#ifdef __ANDROID__
#define __ptrace_request int
#define PT_DETACH PTRACE_DETACH
OpenPOWER on IntegriCloud