[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] w32: Fix build with older gcc (unresolved symbo

From: Igor Mitsyanko
Subject: Re: [Qemu-devel] [PATCH] w32: Fix build with older gcc (unresolved symbol)
Date: Sat, 11 May 2013 00:14:00 +0400
User-agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

On 29.03.2013 21:20, Stefan Weil wrote:
The cross i586-mingw32msvc-gcc 4.4.4 from Debian Squeeze does not support
__sync_val_compare_and_swap by default.

Using -march=i686 fixes that and should also result in better code.

Signed-off-by: Stefan Weil <address@hidden>

Maybe this modification is also needed for native gcc-4.4 and older
on Linux i386. If yes, we can move the new script code out of the
MinGW conditional code.

Newer versions of gcc obviously use -march=i686 by default and
don't need the patch, but it also won't do any harm for those


mingw is built with --build=mingw32 and looks like it defaults to -march=i386 (I have gcc version 4.7.2).
Default build on windows is broken without this patch, it should be
applied to 1.5 probably.

Tested-by: Igor Mitsyanko <address@hidden>

  configure |    5 +++++
  1 file changed, 5 insertions(+)

diff --git a/configure b/configure
index f2af714..70c2219 100755
--- a/configure
+++ b/configure
@@ -562,6 +562,11 @@ if test "$mingw32" = "yes" ; then
    # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
+  if test "$cpu" = "i386"; then
+    # We need something better than i386 for __sync_val_compare_and_swap
+    # and can expect that QEMU will only run on i686 or later.
+    QEMU_CFLAGS="-march=i686 $QEMU_CFLAGS"
+  fi
    LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
  cat > $TMPC << EOF
  int main(void) { return 0; }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]