Skip to contentSkip to conversation

linux-user: fix strace build w/out munlockall

PATCH Superseded Mike Frysinger 3 participants 4 messages Jan 17, 2023 – Jan 25, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: fix strace build w/out munlockall

---
 linux-user/strace.c | 2 ++
 1 file changed, 2 insertions(+)
linux-user/strace.c +2 -0
index 9ae5a812cd71..f7912ad67f2b 100644
@@ -1380,6 +1380,7 @@ UNUSED static struct flags termios_lflags[] = {
     FLAG_END,
 };
 
+#ifdef TARGET_NR_mlockall
 UNUSED static struct flags mlockall_flags[] = {
     FLAG_TARGET(MCL_CURRENT),
     FLAG_TARGET(MCL_FUTURE),
@@ -1388,6 +1389,7 @@ UNUSED static struct flags mlockall_flags[] = {
 #endif
     FLAG_END,
 };
+#endif
 
 /* IDs of the various system clocks */
 #define TARGET_CLOCK_REALTIME              0
Signature · 1 line
2.39.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mike Frysinger
---
  linux-user/strace.c | 2 ++
  1 file changed, 2 insertions(+)
linux-user/strace.c +0 -0
index 9ae5a812cd71..f7912ad67f2b 100644

linux-user/strace.c UNUSED static struct flags termios_lflags[] = { · line 1384

Quoted 5 lines
linux-user/strace.c +1 -0
@@ -1380,6 +1380,7 @@ UNUSED static struct flags termios_lflags[] = {
      FLAG_END,
  };
 
+#ifdef TARGET_NR_mlockall
  UNUSED static struct flags mlockall_flags[] = {

Removing the 'UNUSED' qualifier:

Quoted 10 lines
linux-user/strace.c +1 -0
      FLAG_TARGET(MCL_CURRENT),
      FLAG_TARGET(MCL_FUTURE),
@@ -1388,6 +1389,7 @@ UNUSED static struct flags mlockall_flags[] = {
  #endif
      FLAG_END,
  };
+#endif
 
  /* IDs of the various system clocks */
  #define TARGET_CLOCK_REALTIME              0
#2 lore raw

PATCH v2 1/1 linux-user: fix strace build w/out munlockall

In reply to Mike Frysinger
---
 linux-user/strace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
linux-user/strace.c +3 -1
index 9ae5a812cd71..11a7c3df9498 100644
@@ -1380,7 +1380,8 @@ UNUSED static struct flags termios_lflags[] = {
     FLAG_END,
 };
 
-UNUSED static struct flags mlockall_flags[] = {
+#ifdef TARGET_NR_mlockall
+static struct flags mlockall_flags[] = {
     FLAG_TARGET(MCL_CURRENT),
     FLAG_TARGET(MCL_FUTURE),
 #ifdef MCL_ONFAULT
@@ -1388,6 +1389,7 @@ UNUSED static struct flags mlockall_flags[] = {
 #endif
     FLAG_END,
 };
+#endif
 
 /* IDs of the various system clocks */
 #define TARGET_CLOCK_REALTIME              0
Signature · 1 line
2.39.0
#3 lore raw

Le 18/01/2023 à 10:01, Mike Frysinger a écrit :

Quoted 21 lines
---
  linux-user/strace.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
linux-user/strace.c +2 -1
index 9ae5a812cd71..11a7c3df9498 100644
@@ -1380,7 +1380,8 @@ UNUSED static struct flags termios_lflags[] = {
      FLAG_END,
  };
 
-UNUSED static struct flags mlockall_flags[] = {
+#ifdef TARGET_NR_mlockall
+static struct flags mlockall_flags[] = {
      FLAG_TARGET(MCL_CURRENT),
      FLAG_TARGET(MCL_FUTURE),
  #ifdef MCL_ONFAULT

linux-user/strace.c UNUSED static struct flags mlockall_flags[] = { · line 1395

Quoted 7 lines
linux-user/strace.c +1 -0
@@ -1388,6 +1389,7 @@ UNUSED static struct flags mlockall_flags[] = {
  #endif
      FLAG_END,
  };
+#endif
 
  /* IDs of the various system clocks */
  #define TARGET_CLOCK_REALTIME              0

Applied to my linux-user-for-8.0 branch.

Thanks,
Laurent