diff mbox

linux-user: fix build with musl on aarch64

Message ID 20161215110459.27985-1-ncopa@alpinelinux.org
State New
Headers show

Commit Message

Natanael Copa Dec. 15, 2016, 11:04 a.m. UTC
Use the standard uint64_t instead of internal __u64.

This fixes compiler error with musl libc on aarch64:
.../qemu-2.7.0/linux-user/host/aarch64/hostdep.h:28:5:
error: unknown type name '__u64'
     __u64 *pcreg = &uc->uc_mcontext.pc;
     ^~~~~

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 linux-user/host/aarch64/hostdep.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Tokarev Jan. 12, 2017, 11:29 a.m. UTC | #1
15.12.2016 14:04, Natanael Copa wrote:
> Use the standard uint64_t instead of internal __u64.
> 
> This fixes compiler error with musl libc on aarch64:
> .../qemu-2.7.0/linux-user/host/aarch64/hostdep.h:28:5:
> error: unknown type name '__u64'
>      __u64 *pcreg = &uc->uc_mcontext.pc;
>      ^~~~~
> 
> Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
> ---
>  linux-user/host/aarch64/hostdep.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
> index 64f75cef49..6fd6e36b2a 100644
> --- a/linux-user/host/aarch64/hostdep.h
> +++ b/linux-user/host/aarch64/hostdep.h
> @@ -25,7 +25,7 @@ extern char safe_syscall_end[];
>  static inline void rewind_if_in_safe_syscall(void *puc)
>  {
>      struct ucontext *uc = puc;
> -    __u64 *pcreg = &uc->uc_mcontext.pc;
> +    uint64_t *pcreg = &uc->uc_mcontext.pc;

Is this type available in all places where this header is
being included (apparently these are linux-user/qemu.h and
linux-user/safe-syscall.S, with the latter not being
interesting. But in linux-user/qemu.h, this is the first
file which is included..

Why do we have a mix of __u64 and uint64_t ? :)

Hmm.

/mjt

>      if (*pcreg > (uintptr_t)safe_syscall_start
>          && *pcreg < (uintptr_t)safe_syscall_end) {
>
diff mbox

Patch

diff --git a/linux-user/host/aarch64/hostdep.h b/linux-user/host/aarch64/hostdep.h
index 64f75cef49..6fd6e36b2a 100644
--- a/linux-user/host/aarch64/hostdep.h
+++ b/linux-user/host/aarch64/hostdep.h
@@ -25,7 +25,7 @@  extern char safe_syscall_end[];
 static inline void rewind_if_in_safe_syscall(void *puc)
 {
     struct ucontext *uc = puc;
-    __u64 *pcreg = &uc->uc_mcontext.pc;
+    uint64_t *pcreg = &uc->uc_mcontext.pc;
 
     if (*pcreg > (uintptr_t)safe_syscall_start
         && *pcreg < (uintptr_t)safe_syscall_end) {