Received: from eggs.gnu.org ([2001:4830:134:3::10]:44277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aly4S-0007aH-MH for qemu-devel@nongnu.org; Fri, 01 Apr 2016 08:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aly4M-0005oG-Og for qemu-devel@nongnu.org; Fri, 01 Apr 2016 08:21:00 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::12]:31314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aly4M-0005np-FP for qemu-devel@nongnu.org; Fri, 01 Apr 2016 08:20:54 -0400 Resent-Message-ID: <20160401121423.GA4243@aepfle.de> Resent-To: qemu-devel@nongnu.org, pbonzini@redhat.com, berrange@redhat.com, stefanha@redhat.com, peter.maydell@linaro.org, stefano.stabellini@eu.citrix.com From: Olaf Hering Date: Fri, 1 Apr 2016 14:00:47 +0200 Message-Id: <1459512047-2344-1-git-send-email-olaf@aepfle.de> Subject: [Qemu-devel] [PATCH] build: link with libatomic on powerpc-linux List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Cc: Paolo Bonzini Cc: "Daniel P. Berrange" Cc: Stefan Hajnoczi Cc: Peter Maydell Cc: Stefano Stabellini --- 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 + #include + #include + 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