From: Olaf Hering <olaf@aepfle.de>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Olaf Hering <olaf@aepfle.de>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH v2] build: link with libatomic on powerpc-linux
Date: Fri, 1 Apr 2016 14:26:36 +0200 [thread overview]
Message-ID: <1459513596-4362-1-git-send-email-olaf@aepfle.de> (raw)
Building on powerpc-linux fails with undefined reference to
__atomic_load_8 in icount_warp_rt(). Force linking to -latomic.
Fixes a0aa44b ("include/qemu/atomic.h: default to __atomic functions")
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
This was probably sent twice due to git send-email issues...
configure | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/configure b/configure
index 81caff6..ee935bb 100755
--- a/configure
+++ b/configure
@@ -4025,6 +4025,33 @@ if test "$usb_redir" != "no" ; then
fi
fi
+if test "$cpu" = "ppc" && test "$targetos" = "Linux" ; then
+ # Do we need libm
+ cat > $TMPC << EOF
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <qemu/atomic.h>
+ int64_t val;
+ int main(int argc, char **argv)
+ {
+ val = (int64_t)read(0, NULL, 0);
+ if (atomic_read(&val) == -1) {
+ return 0;
+ }
+ return 1;
+ }
+EOF
+ if compile_prog "-Iinclude" "" ; then
+ :
+ echo "No need to link with -latomic on powerpc-linux"
+ elif compile_prog "-Iinclude" "-latomic" ; then
+ echo "Link with -latomic on powerpc-linux"
+ libs_softmmu="$libs_softmmu -latomic"
+ else
+ error_exit "libatomic check failed"
+ fi
+fi
+
##########################################
# check if we have VSS SDK headers for win
reply other threads:[~2016-04-01 12:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1459513596-4362-1-git-send-email-olaf@aepfle.de \
--to=olaf@aepfle.de \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=stefano.stabellini@eu.citrix.com \
/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).