[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH fix for 2.1 v2] makefile: Fix tools compile
From: |
Alexey Kardashevskiy |
Subject: |
[Qemu-devel] [PATCH fix for 2.1 v2] makefile: Fix tools compile |
Date: |
Tue, 1 Jul 2014 17:30:27 +1000 |
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 <address@hidden>
---
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 <math.h>
-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
- [Qemu-devel] [PATCH fix for 2.1 v2] makefile: Fix tools compile,
Alexey Kardashevskiy <=