[Lldb-commits] [lldb] r292939 - Fix android build for r292935 (personality.h)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 24 07:35:53 PST 2017


Author: labath
Date: Tue Jan 24 09:35:53 2017
New Revision: 292939

URL: http://llvm.org/viewvc/llvm-project?rev=292939&view=rev
Log:
Fix android build for r292935 (personality.h)

It turns out things are not as simple as I hoped. sys/personality.h
exists on all androids but it does not define the required symbols on
all platform levels.

Add a compile check for platform level to compile against both new and
old android headers.

Modified:
    lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp

Modified: lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp?rev=292939&r1=292938&r2=292939&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp (original)
+++ lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp Tue Jan 24 09:35:53 2017
@@ -16,16 +16,21 @@
 #include "lldb/Target/ProcessLaunchInfo.h"
 
 #include <limits.h>
-#ifndef __ANDROID__
-#include <sys/personality.h>
-#else
-#include <linux/personality.h>
-#endif
 #include <sys/ptrace.h>
 #include <sys/wait.h>
 
 #include <sstream>
 
+#ifdef __ANDROID__
+#include <android/api-level.h>
+#endif
+
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+#include <linux/personality.h>
+#else
+#include <sys/personality.h>
+#endif
+
 using namespace lldb;
 using namespace lldb_private;
 




More information about the lldb-commits mailing list