* [Qemu-devel] [PATCH] build: link with libatomic on powerpc-linux
@ 2016-04-01 12:00 Olaf Hering
2016-04-01 12:24 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2016-04-01 12:00 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Olaf Hering, Stefano Stabellini, Stefan Hajnoczi,
Paolo Bonzini
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] build: link with libatomic on powerpc-linux
2016-04-01 12:00 [Qemu-devel] [PATCH] build: link with libatomic on powerpc-linux Olaf Hering
@ 2016-04-01 12:24 ` Peter Maydell
2016-04-01 15:31 ` Olaf Hering
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2016-04-01 12:24 UTC (permalink / raw)
To: Olaf Hering
Cc: Paolo Bonzini, QEMU Developers, Stefan Hajnoczi, Stefano Stabellini
On 1 April 2016 at 13:00, Olaf Hering <olaf@aepfle.de> wrote:
> Building on powerpc-linux fails with undefined reference to __atomic_load_8 in
> icount_warp_rt(). Force linking to -latomic.
We should instead be fixing this by not doing atomic operations
on types of larger than void*. This also causes problems on x86
BSDs. I think there's already a proposed patch on the list for that.
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] build: link with libatomic on powerpc-linux
2016-04-01 12:24 ` Peter Maydell
@ 2016-04-01 15:31 ` Olaf Hering
0 siblings, 0 replies; 3+ messages in thread
From: Olaf Hering @ 2016-04-01 15:31 UTC (permalink / raw)
To: Peter Maydell
Cc: Paolo Bonzini, QEMU Developers, Stefan Hajnoczi, Stefano Stabellini
On Fri, Apr 01, Peter Maydell wrote:
> On 1 April 2016 at 13:00, Olaf Hering <olaf@aepfle.de> wrote:
> > Building on powerpc-linux fails with undefined reference to __atomic_load_8 in
> > icount_warp_rt(). Force linking to -latomic.
>
> We should instead be fixing this by not doing atomic operations
> on types of larger than void*. This also causes problems on x86
> BSDs. I think there's already a proposed patch on the list for that.
Do you have a pointer to the proposed patch?
My change does not work for the --enable-linux-user case for some
reason.
Olaf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-01 15:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-01 12:00 [Qemu-devel] [PATCH] build: link with libatomic on powerpc-linux Olaf Hering
2016-04-01 12:24 ` Peter Maydell
2016-04-01 15:31 ` Olaf Hering
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.