From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1sWk-0008DI-G8 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:31:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1sWZ-0007vP-61 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:30:54 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:38957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1sWY-0007ur-CE for qemu-devel@nongnu.org; Tue, 01 Jul 2014 03:30:43 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Jul 2014 17:30:32 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 7D6652BB0040 for ; Tue, 1 Jul 2014 17:30:30 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s617E11c62128290 for ; Tue, 1 Jul 2014 17:14:01 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s617UToO030051 for ; Tue, 1 Jul 2014 17:30:30 +1000 From: Alexey Kardashevskiy Date: Tue, 1 Jul 2014 17:30:27 +1000 Message-Id: <1404199827-7823-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH fix for 2.1 v2] makefile: Fix tools compile List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Peter Maydell , Paolo Bonzini 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 : -- 2.0.0