Fix build of lldb-gdbserver and lldb-platform for android (arm32, x86)

* Fix cmake script for android x86
* Reorder includes to avoid collision between system macros and local
  variables in clang framework

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

llvm-svn: 228388
This commit is contained in:
Tamas Berghammer 2015-02-06 10:57:40 +00:00
parent 5830aa755b
commit d858487edd
3 changed files with 30 additions and 34 deletions

View File

@ -41,7 +41,7 @@ set( __ANDROID_NDK__ True )
set( ANDROID_ABI "${ANDROID_ABI}" CACHE INTERNAL "Android Abi" FORCE ) set( ANDROID_ABI "${ANDROID_ABI}" CACHE INTERNAL "Android Abi" FORCE )
if( ANDROID_ABI STREQUAL "x86" ) if( ANDROID_ABI STREQUAL "x86" )
set( CMAKE_SYSTEM_PROCESSOR "i686" ) 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" ) elseif( ANDROID_ABI STREQUAL "x86_64" )
set( CMAKE_SYSTEM_PROCESSOR "x86_64" ) set( CMAKE_SYSTEM_PROCESSOR "x86_64" )
set( ANDROID_TOOLCHAIN_NAME "x86_64-linux-android" ) set( ANDROID_TOOLCHAIN_NAME "x86_64-linux-android" )

View File

@ -17,23 +17,6 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include <unistd.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__) #if defined (__arm64__) || defined (__aarch64__)
// NT_PRSTATUS and NT_FPREGSET definition // NT_PRSTATUS and NT_FPREGSET definition
@ -69,6 +52,21 @@
#include "ThreadStateCoordinator.h" #include "ThreadStateCoordinator.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.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__ #ifdef __ANDROID__
#define __ptrace_request int #define __ptrace_request int
#define PT_DETACH PTRACE_DETACH #define PT_DETACH PTRACE_DETACH

View File

@ -16,22 +16,6 @@
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
#include <elf.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 // C++ Includes
// Other libraries and framework includes // Other libraries and framework includes
@ -52,6 +36,20 @@
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "ProcessMonitor.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__ #ifdef __ANDROID__
#define __ptrace_request int #define __ptrace_request int
#define PT_DETACH PTRACE_DETACH #define PT_DETACH PTRACE_DETACH