Skip to contentSkip to conversation

[Qemu-devel] [PATCH for-1.5 0/2]

PATCH Applied Stefan Weil 2 participants 5 messages May 11, 2013 – May 16, 2013

lore
Share & tools
lore
#0 lore raw

cover [Qemu-devel] [PATCH for-1.5 0/2]

These patches are needed to fix the currently broken build with MinGW.

Patch 1 fixes a problem reported on qemu-devel. Patch 2 fixes a problem which is reported by our buildbots.

[PATCH for-1.5 1/2] w32: Fix configure test for -march=i486 [PATCH for-1.5 2/2] w32: Include stdio.h to get the declaration of ssize_t

Both patches should be used for QEMU 1.5.

Regards,

Stefan W.

#1 lore raw

PATCH 1/2 w32: Fix configure test for -march=i486

The latest version of MinGW needs a test for __sync_val_compare_and_swap to fix a missing symbol linker error.

---
 configure |    1 +
 1 file changed, 1 insertion(+)
configure +1 -0
index 9439f1c..3a75f66 100755
@@ -1341,6 +1341,7 @@ static int sfaa(int *ptr)
 int main(void)
 {
   int val = 42;
+  val = __sync_val_compare_and_swap(&val, 0, 1);
   sfaa(&val);
   return val;
 }
Signature · 1 line
1.7.10.4
#2 lore raw

Re: [Qemu-devel] [PATCH for-1.5 1/2] w32: Fix configure test for -march=i486

Am 11.05.2013 21:46, schrieb Stefan Weil:

Quoted 14 lines

The latest version of MinGW needs a test for __sync_val_compare_and_swap to fix a missing symbol linker error.

---
 configure |    1 +
 1 file changed, 1 insertion(+)
configure +0 -0
index 9439f1c..3a75f66 100755

configure static int sfaa(int *ptr) · line 1347

Quoted 7 lines
configure +1 -0
@@ -1341,6 +1341,7 @@ static int sfaa(int *ptr)
 int main(void)
 {
   int val = 42;
+  val = __sync_val_compare_and_swap(&val, 0, 1);
   sfaa(&val);
   return val;
 }

Ping. The above patch 1 is still needed for latest QEMU.

Patch 2 is no longer needed.

Regards,
Stefan Weil

#3 lore raw

PATCH 2/2 w32: Include stdio.h to get the declaration of ssize_t

In reply to Stefan Weil

Latest native MinGW and also the Debian squeeze cross version declare ssize_t in sys/types.h which is not included by osdep.h. This results in a compiler error for several files:

CC util/hbitmap.o
In file included from C:/qemu/util/hbitmap.c:15:0:
C:/qemu/include/qemu/osdep.h:175:1: error: unknown type name 'ssize_t' C:/qemu/include/qemu/osdep.h:176:1: error: unknown type name 'ssize_t'
make: *** [util/hbitmap.o] Error 1

Including stdio.h is a trick which gets the necessary declaration in a portable way. It also includes stdarg.h, so that include statement can be safely removed.

---
 include/qemu/osdep.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/qemu/osdep.h +1 -1
index 42545bc..822512f 100644
@@ -2,9 +2,9 @@
 #define QEMU_OSDEP_H
 
 #include "config-host.h"
-#include <stdarg.h>
 #include <stddef.h>
 #include <stdbool.h>
+#include <stdio.h>
 #ifdef __OpenBSD__
 #include <sys/types.h>
 #include <sys/signal.h>
Signature · 1 line
1.7.10.4