Skip to contentSkip to conversation

risu: Include <sys/user.h> on ppc64

PATCH In review Peter Maydell 3 participants 4 messages Jun 7, 2019 – Jun 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 risu: Include <sys/user.h> on ppc64

To build the C parts of risu for ppc64le with recent glibc/kernel headers, we need to include sys/user.h to avoid a compile error, because sys/ucontext.h defines a struct which includes a pointer to 'struct pt_regs' but does not provide a definition of that struct.

---
I need this to be able to do the ppc64le cross-build on my Ubuntu Bionic x86-64 system.

 risu_ppc64.c         | 2 ++
 risu_reginfo_ppc64.c | 1 +
 2 files changed, 3 insertions(+)
risu_ppc64.c +2 -0
index 83f8d1f..a3028f7 100644
@@ -11,6 +11,8 @@
  *     based on Peter Maydell's risu_arm.c
  *****************************************************************************/
 
+#include <sys/user.h>
+
 #include "risu.h"
 
 void advance_pc(void *vuc)
risu_reginfo_ppc64.c +1 -0
index f9d2f0d..071c951 100644
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <math.h>
 #include <stdlib.h>
+#include <sys/user.h>
 
 #include "risu.h"
 #include "risu_reginfo_ppc64.h"
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Peter Maydell

To build the C parts of risu for ppc64le with recent glibc/kernel headers, we need to include sys/user.h to avoid a compile error, because sys/ucontext.h defines a struct which includes a pointer to 'struct pt_regs' but does not provide a definition of that struct.

Quoted 26 lines

---
I need this to be able to do the ppc64le cross-build on my Ubuntu Bionic x86-64 system.

 risu_ppc64.c         | 2 ++
 risu_reginfo_ppc64.c | 1 +
 2 files changed, 3 insertions(+)
risu_ppc64.c +2 -0
index 83f8d1f..a3028f7 100644
@@ -11,6 +11,8 @@
  *     based on Peter Maydell's risu_arm.c
  *****************************************************************************/
 
+#include <sys/user.h>
+
 #include "risu.h"
 
 void advance_pc(void *vuc)
risu_reginfo_ppc64.c +0 -0
index f9d2f0d..071c951 100644

risu_reginfo_ppc64.c line 22

Quoted 7 lines
risu_reginfo_ppc64.c +1 -0
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <math.h>
 #include <stdlib.h>
+#include <sys/user.h>
 
 #include "risu.h"
 #include "risu_reginfo_ppc64.h"

--
Alex Bennée

Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Maydell
Quoted 6 lines · Peter Maydell

To build the C parts of risu for ppc64le with recent glibc/kernel headers, we need to include sys/user.h to avoid a compile error, because sys/ucontext.h defines a struct which includes a pointer to 'struct pt_regs' but does not provide a definition of that struct.

LGTM.

Quoted 34 lines

---
I need this to be able to do the ppc64le cross-build on my Ubuntu Bionic x86-64 system.

 risu_ppc64.c         | 2 ++
 risu_reginfo_ppc64.c | 1 +
 2 files changed, 3 insertions(+)
risu_ppc64.c +2 -0
index 83f8d1f..a3028f7 100644
@@ -11,6 +11,8 @@
  *     based on Peter Maydell's risu_arm.c
  *****************************************************************************/
 
+#include <sys/user.h>
+
 #include "risu.h"
 
 void advance_pc(void *vuc)
risu_reginfo_ppc64.c +1 -0
index f9d2f0d..071c951 100644
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <math.h>
 #include <stdlib.h>
+#include <sys/user.h>
 
 #include "risu.h"
 #include "risu_reginfo_ppc64.h"
#3 lore raw
Quoted 9 lines · Sandipan Das
Quoted 5 lines · Peter Maydell

To build the C parts of risu for ppc64le with recent glibc/kernel headers, we need to include sys/user.h to avoid a compile error, because sys/ucontext.h defines a struct which includes a pointer to 'struct pt_regs' but does not provide a definition of that struct.

Quoted 5 lines
Quoted 1 line

LGTM.

Thanks; pushed to risu master.

-- PMM