qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile
Date: Tue,  1 Jul 2014 11:51:00 +1000	[thread overview]
Message-ID: <1404179460-29303-1-git-send-email-aik@ozlabs.ru> (raw)

The existing test whether "-lm" needs to be included or not is
insufficient as it reports false negative on Fedora20/ppc64.
As the result, qemu-nbd/qemu-io/qemu-img tools cannot compile.

This replaces sin() with log() in the test.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

---

The bug was triggered by efc6de0d0eb21bbd8fbc90da1faf7dd8ed9f5321
"block/iscsi: handle BUSY condition" which does not anything wrong :)

It compiled well on Fedora19 though what is weird.

Is log() good enough or we need to test for both?

Thanks.


ps. this is my test on the system upgraded from fc19 yesterday:

[aik@vpl2 ~]$ cat b.c
#include <math.h>
int main(void) { return isnan(log(0.0)); }

[aik@vpl2 ~]$ gcc b.c -o b
/tmp/ccqp1EI4.o: In function `main':
b.c:(.text+0x20): undefined reference to `log'
collect2: error: ld returned 1 exit status
[aik@vpl2 ~]$ gcc b.c -o b -lm
[aik@vpl2 ~]$ cat /etc/issue
Fedora release 20 (Heisenbug)
Kernel \r on an \m (\l)


---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 23ecb37..c7a2922 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)); }
+int main(void) { return isnan(log(0.0)); }
 EOF
 if compile_prog "" "" ; then
   :
-- 
2.0.0

             reply	other threads:[~2014-07-01  1:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01  1:51 Alexey Kardashevskiy [this message]
2014-07-01  5:42 ` [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile Alexey Kardashevskiy
2014-07-01  6:52   ` Paolo Bonzini
2014-07-01  8:19     ` Peter Maydell
2014-07-01  8:26       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404179460-29303-1-git-send-email-aik@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).