[V2,1/6] Android NDK: elf.h missing defines

Submitted by Zhang, Ning A on April 2, 2019, 2:42 a.m.

Details

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

Commit Message

Zhang, Ning A April 2, 2019, 2:42 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>
---
 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
  */

Comments

Dmitry Safonov April 2, 2019, 2:32 p.m.
On Tue, 2 Apr 2019 at 03:44, <ning.a.zhang@intel.com> wrote:
>
> 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(+)
>
> 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
>   */
> --
> 2.20.1
>
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu

Thanks,
             Dmitry