From patchwork Tue Jul 1 07:41:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 365884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 60BEE1400F1 for ; Tue, 1 Jul 2014 17:42:11 +1000 (EST) Received: from localhost ([::1]:39030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1shd-00050F-67 for incoming@patchwork.ozlabs.org; Tue, 01 Jul 2014 03:42:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1shH-0004jP-3D for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:41:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1shB-0003DV-VS for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:41:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1shB-0003DO-M3 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:41:41 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s617fcFI015554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 Jul 2014 03:41:39 -0400 Received: from yakj.usersys.redhat.com (ovpn-112-20.ams2.redhat.com [10.36.112.20]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s617faHE009435; Tue, 1 Jul 2014 03:41:37 -0400 Message-ID: <53B2662F.7040300@redhat.com> Date: Tue, 01 Jul 2014 09:41:35 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alexey Kardashevskiy , qemu-devel@nongnu.org References: <1404199827-7823-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1404199827-7823-1-git-send-email-aik@ozlabs.ru> X-Enigmail-Version: 1.6 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell Subject: Re: [Qemu-devel] [PATCH fix for 2.1 v2] makefile: Fix tools compile 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 Il 01/07/2014 09:30, Alexey Kardashevskiy ha scritto: > The existing test whether "-lm" needs to be included or not is > insufficient as it reports false negative on Fedora20/ppc64. > This happens because sin(0.0) is a constant value which compiler > can safely throw away and therefore there is no need to add "-lm". > As the result, qemu-nbd/qemu-io/qemu-img tools cannot compile. > > This adds a global variable and uses it in the test to prevent > from optimization. > > Signed-off-by: Alexey Kardashevskiy > > --- > Changes: > v2: > * previous s/sin/log/ replacement removed, a global variable is > used instead > --- > configure | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configure b/configure > index 23ecb37..6dd44a9 100755 > --- a/configure > +++ b/configure > @@ -3453,7 +3453,7 @@ fi > # Do we need libm > cat > $TMPC << EOF > #include > -int main(void) { return isnan(sin(0.0)); } > +double x; int main(void) {return isnan(sin(x));} > EOF > if compile_prog "" "" ; then > : > Can you please test with this hunk on top: It should now be unnecessary. Paolo diff --git a/Makefile.target b/Makefile.target index 6089d29..137d0b0 100644 --- a/Makefile.target +++ b/Makefile.target @@ -163,10 +163,6 @@ dummy := $(call unnest-vars,.., \ all-obj-y += $(common-obj-y) all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) -ifndef CONFIG_HAIKU -LIBS+=-lm -endif - # build either PROG or PROGW $(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a $(call LINK,$^)