[V4,1/5] Android NDK: elf.h missing defines

Submitted by Zhang, Ning A on April 9, 2019, 1:20 a.m.

Details

Message ID 20190409012100.12683-2-ning.a.zhang@intel.com
State Accepted
Series "patches for build with Android NDK"
Headers show

Commit Message

Zhang, Ning A April 9, 2019, 1:20 a.m.
From: Zhang Ning <ning.a.zhang@intel.com>

in Android NDK, <elf.h> doesn't has define for:
NT_X86_XSTATE
NT_PRSTATUS

so add these defines to pass compile.

NOTE: add <linux/elf.h> will have more build errors

Cc: Chen Hu <hu1.chen@intel.com>
Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
---
 compel/arch/x86/src/lib/infect.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/compel/arch/x86/src/lib/infect.c b/compel/arch/x86/src/lib/infect.c
index 9cb5d82e..cb3e7759 100644
--- a/compel/arch/x86/src/lib/infect.c
+++ b/compel/arch/x86/src/lib/infect.c
@@ -20,6 +20,13 @@ 
 #include "infect-priv.h"
 #include "log.h"
 
+#ifndef NT_X86_XSTATE
+#define NT_X86_XSTATE	0x202		/* x86 extended state using xsave */
+#endif
+#ifndef NT_PRSTATUS
+#define NT_PRSTATUS	1		/* Contains copy of prstatus struct */
+#endif
+
 /*
  * Injected syscall instruction
  */