Skip to contentSkip to conversation

linux-user: Fix build failure caused by missing __u64 on musl

PATCH Applied Yao Zi 3 participants 3 messages Oct 22, 2024

lore
Share & tools
lore

Yao Zi

author
#0 lore raw

PATCH 1/1 linux-user: Fix build failure caused by missing __u64 on musl

Commit 9651cead2f ("linux-user: add openat2 support in linux-user") ships a definition of struct open_how_ver0 while assuming type __u64 is available in code, which is not the case when building QEMU on musl. Let's replaces __u64 with uint64_t.

Fixes 9651cead2f ("linux-user: add openat2 support in linux-user")
---
 linux-user/syscall_defs.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/syscall_defs.h +3 -3
index 0ade83745e..0e08dfae3e 100644
@@ -2750,9 +2750,9 @@ struct target_sched_param {
 
 /* from kernel's include/uapi/linux/openat2.h */
 struct open_how_ver0 {
-    __u64 flags;
-    __u64 mode;
-    __u64 resolve;
+    uint64_t flags;
+    uint64_t mode;
+    uint64_t resolve;
 };
 struct target_open_how_ver0 {
     abi_ullong flags;
Signature · 1 line
2.46.2
Reviewed-by on v1 1/1
#1 lore raw

Le 22/10/2024 à 14:29, Yao Zi a écrit :

Quoted 18 lines

Commit 9651cead2f ("linux-user: add openat2 support in linux-user") ships a definition of struct open_how_ver0 while assuming type __u64 is available in code, which is not the case when building QEMU on musl. Let's replaces __u64 with uint64_t.

Fixes 9651cead2f ("linux-user: add openat2 support in linux-user")
---
  linux-user/syscall_defs.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/syscall_defs.h +0 -0
index 0ade83745e..0e08dfae3e 100644
@@ -2750,9 +2750,9 @@ struct target_sched_param {
 
  /* from kernel's include/uapi/linux/openat2.h */

linux-user/syscall_defs.h struct target_sched_param { · line 2758

Quoted 10 lines
linux-user/syscall_defs.h +3 -3
  struct open_how_ver0 {
-    __u64 flags;
-    __u64 mode;
-    __u64 resolve;
+    uint64_t flags;
+    uint64_t mode;
+    uint64_t resolve;
  };
  struct target_open_how_ver0 {
      abi_ullong flags;
Reviewed-by on v1 1/1 Applied
#2 lore raw
In reply to Yao Zi
Quoted 18 lines · Yao Zi

Commit 9651cead2f ("linux-user: add openat2 support in linux-user") ships a definition of struct open_how_ver0 while assuming type __u64 is available in code, which is not the case when building QEMU on musl. Let's replaces __u64 with uint64_t.

Fixes 9651cead2f ("linux-user: add openat2 support in linux-user")
---
  linux-user/syscall_defs.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/syscall_defs.h +0 -0
index 0ade83745e..0e08dfae3e 100644
@@ -2750,9 +2750,9 @@ struct target_sched_param {
 
  /* from kernel's include/uapi/linux/openat2.h */

linux-user/syscall_defs.h struct target_sched_param { · line 2758

Quoted 10 lines
linux-user/syscall_defs.h +3 -3
  struct open_how_ver0 {
-    __u64 flags;
-    __u64 mode;
-    __u64 resolve;
+    uint64_t flags;
+    uint64_t mode;
+    uint64_t resolve;
  };
  struct target_open_how_ver0 {
      abi_ullong flags;

Queued, thanks.

r~