diff mbox series

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

Message ID 20190607132521.9637-1-peter.maydell@linaro.org
State New
Headers show
Series [RISU] risu: Include <sys/user.h> on ppc64 | expand

Commit Message

Peter Maydell June 7, 2019, 1:25 p.m. UTC
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.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
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(+)

Comments

Alex Bennée June 7, 2019, 2 p.m. UTC | #1
Peter Maydell <peter.maydell@linaro.org> writes:

> 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.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
> 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(+)
>
> diff --git a/risu_ppc64.c b/risu_ppc64.c
> index 83f8d1f..a3028f7 100644
> --- a/risu_ppc64.c
> +++ b/risu_ppc64.c
> @@ -11,6 +11,8 @@
>   *     based on Peter Maydell's risu_arm.c
>   *****************************************************************************/
>
> +#include <sys/user.h>
> +
>  #include "risu.h"
>
>  void advance_pc(void *vuc)
> diff --git a/risu_reginfo_ppc64.c b/risu_reginfo_ppc64.c
> index f9d2f0d..071c951 100644
> --- a/risu_reginfo_ppc64.c
> +++ b/risu_reginfo_ppc64.c
> @@ -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
Sandipan Das June 10, 2019, 4:25 a.m. UTC | #2
On 07/06/19 6:55 PM, Peter Maydell wrote:
> 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.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

LGTM.

Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>

> ---
> 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(+)
> 
> diff --git a/risu_ppc64.c b/risu_ppc64.c
> index 83f8d1f..a3028f7 100644
> --- a/risu_ppc64.c
> +++ b/risu_ppc64.c
> @@ -11,6 +11,8 @@
>   *     based on Peter Maydell's risu_arm.c
>   *****************************************************************************/
> 
> +#include <sys/user.h>
> +
>  #include "risu.h"
> 
>  void advance_pc(void *vuc)
> diff --git a/risu_reginfo_ppc64.c b/risu_reginfo_ppc64.c
> index f9d2f0d..071c951 100644
> --- a/risu_reginfo_ppc64.c
> +++ b/risu_reginfo_ppc64.c
> @@ -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"
>
Peter Maydell June 13, 2019, 12:33 p.m. UTC | #3
On Mon, 10 Jun 2019 at 05:25, Sandipan Das <sandipan@linux.ibm.com> wrote:
>
>
>
> On 07/06/19 6:55 PM, Peter Maydell wrote:
> > 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.
> >
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>
> LGTM.
>
> Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>

Thanks; pushed to risu master.

-- PMM
diff mbox series

Patch

diff --git a/risu_ppc64.c b/risu_ppc64.c
index 83f8d1f..a3028f7 100644
--- a/risu_ppc64.c
+++ b/risu_ppc64.c
@@ -11,6 +11,8 @@ 
  *     based on Peter Maydell's risu_arm.c
  *****************************************************************************/
 
+#include <sys/user.h>
+
 #include "risu.h"
 
 void advance_pc(void *vuc)
diff --git a/risu_reginfo_ppc64.c b/risu_reginfo_ppc64.c
index f9d2f0d..071c951 100644
--- a/risu_reginfo_ppc64.c
+++ b/risu_reginfo_ppc64.c
@@ -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"