From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPYQw-0002gV-RB for qemu-devel@nongnu.org; Tue, 09 Apr 2013 09:18:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPYQs-0005Vx-6p for qemu-devel@nongnu.org; Tue, 09 Apr 2013 09:17:58 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:64519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPYQs-0005V6-0G for qemu-devel@nongnu.org; Tue, 09 Apr 2013 09:17:54 -0400 Received: by mail-wi0-f169.google.com with SMTP id c10so4977303wiw.4 for ; Tue, 09 Apr 2013 06:17:53 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 9 Apr 2013 15:17:48 +0200 Message-Id: <1365513468-1988-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v2] configure: remove duplicate test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org We already had a test to add -march=i486 when needed. Make the existing test independent of vhost-net, so that it is also used under Win32. Also move the test earlier to avoid mucking with QEMU_CFLAGS too late in the configure process. Signed-off-by: Paolo Bonzini --- v1->v2: move test early configure | 56 ++++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/configure b/configure index b12d9ac..b2e0804 100755 --- a/configure +++ b/configure @@ -571,11 +571,6 @@ 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; } @@ -1308,9 +1303,33 @@ EOF fi fi -# +########################################## +# __sync_fetch_and_and requires at least -march=i486. Many toolchains +# use i686 as default anyway, but for those that don't, an explicit +# specification is necessary + +if test "$cpu" = "i386"; then + cat > $TMPC << EOF +static int sfaa(int *ptr) +{ + return __sync_fetch_and_and(ptr, 0); +} + +int main(void) +{ + int val = 42; + sfaa(&val); + return val; +} +EOF + if ! compile_prog "" "" ; then + QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" + fi +fi + +######################################### # Solaris specific configure tool chain decisions -# + if test "$solaris" = "yes" ; then if has $install; then : @@ -3047,29 +3066,6 @@ if test "$trace_backend" = "dtrace"; then fi ########################################## -# __sync_fetch_and_and requires at least -march=i486. Many toolchains -# use i686 as default anyway, but for those that don't, an explicit -# specification is necessary -if test "$vhost_net" = "yes" && test "$cpu" = "i386"; then - cat > $TMPC << EOF -static int sfaa(int *ptr) -{ - return __sync_fetch_and_and(ptr, 0); -} - -int main(void) -{ - int val = 42; - sfaa(&val); - return val; -} -EOF - if ! compile_prog "" "" ; then - QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" - fi -fi - -########################################## # check and set a backend for coroutine # We prefer ucontext, but it's not always possible. The fallback -- 1.8.1.4