[Lldb-commits] [lldb] r228388 - Fix build of lldb-gdbserver and lldb-platform for android (arm32, x86)

Tamas Berghammer tberghammer at google.com
Fri Feb 6 02:57:40 PST 2015


Author: tberghammer
Date: Fri Feb  6 04:57:40 2015
New Revision: 228388

URL: http://llvm.org/viewvc/llvm-project?rev=228388&view=rev
Log:
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

Modified:
    lldb/trunk/cmake/platforms/Android.cmake
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
    lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp

Modified: lldb/trunk/cmake/platforms/Android.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/platforms/Android.cmake?rev=228388&r1=228387&r2=228388&view=diff
==============================================================================
--- lldb/trunk/cmake/platforms/Android.cmake (original)
+++ lldb/trunk/cmake/platforms/Android.cmake Fri Feb  6 04:57:40 2015
@@ -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" )

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=228388&r1=228387&r2=228388&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Fri Feb  6 04:57:40 2015
@@ -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

Modified: lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=228388&r1=228387&r2=228388&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/ProcessMonitor.cpp Fri Feb  6 04:57:40 2015
@@ -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





More information about the lldb-commits mailing list