From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uathd-00058R-Pq for qemu-devel@nongnu.org; Fri, 10 May 2013 16:14:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uathb-0004gA-DP for qemu-devel@nongnu.org; Fri, 10 May 2013 16:14:05 -0400 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:48717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uathb-0004g6-6D for qemu-devel@nongnu.org; Fri, 10 May 2013 16:14:03 -0400 Received: by mail-la0-f53.google.com with SMTP id eo20so4353230lab.40 for ; Fri, 10 May 2013 13:14:02 -0700 (PDT) Message-ID: <518D5508.8000308@gmail.com> Date: Sat, 11 May 2013 00:14:00 +0400 From: Igor Mitsyanko MIME-Version: 1.0 References: <1364577620-32630-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1364577620-32630-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] w32: Fix build with older gcc (unresolved symbol) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Blue Swirl , Peter Maydell , aliguori@us.ibm.com, qemu-devel@nongnu.org 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 > --- > > 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 > versions. > > Stefan > 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 > > 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 > QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" > # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) > QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" > + 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; } >