From patchwork Mon Jul 11 12:57:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Mauerer X-Patchwork-Id: 104207 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 74AFCB6F76 for ; Mon, 11 Jul 2011 23:12:40 +1000 (EST) Received: from localhost ([::1]:37849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgGHs-00067D-KT for incoming@patchwork.ozlabs.org; Mon, 11 Jul 2011 09:12:37 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgG2g-0003lg-3w for qemu-devel@nongnu.org; Mon, 11 Jul 2011 08:56:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QgG2e-0005st-Ef for qemu-devel@nongnu.org; Mon, 11 Jul 2011 08:56:53 -0400 Received: from gecko.sbs.de ([194.138.37.40]:17332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgG2d-0005sU-Tv; Mon, 11 Jul 2011 08:56:52 -0400 Received: from mail2.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.13.6/8.13.6) with ESMTP id p6BCumg6002562; Mon, 11 Jul 2011 14:56:48 +0200 Received: from localhost.localdomain ([146.254.15.72]) by mail2.sbs.de (8.13.6/8.13.6) with ESMTP id p6BCulsX029065; Mon, 11 Jul 2011 14:56:48 +0200 From: Wolfgang Mauerer To: qemu-devel@nongnu.org Date: Mon, 11 Jul 2011 14:57:43 +0200 Message-Id: <1310389063-16382-1-git-send-email-wolfgang.mauerer@siemens.com> X-Mailer: git-send-email 1.6.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.138.37.40 Cc: qemu-trivial@nongnu.org Subject: [Qemu-devel] [PATCH] vhost build fix for i386 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org vhost.c uses __sync_fetch_and_and(), which is only available for -march=i486 and above (see https://bugzilla.redhat.com/show_bug.cgi?id=624279). Signed-off-by: Wolfgang Mauerer --- configure | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 88159ac..3b6facb 100755 --- a/configure +++ b/configure @@ -2464,6 +2464,29 @@ 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 +int sfaa(unsigned *ptr) +{ + return __sync_fetch_and_and(ptr, 0); +} + +int main(int argc, char **argv) +{ + int val = 42; + sfaa(&val); + return val; +} +EOF + if ! compile_prog "" "" ; then + CFLAGS+="-march=i486" + fi +fi + +########################################## # End of CC checks # After here, no more $cc or $ld runs