From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alyN7-0005oZ-EU for qemu-devel@nongnu.org; Fri, 01 Apr 2016 08:40:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alyN3-0001gm-W6 for qemu-devel@nongnu.org; Fri, 01 Apr 2016 08:40:17 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::12]:26874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alyN3-0001g9-M9 for qemu-devel@nongnu.org; Fri, 01 Apr 2016 08:40:13 -0400 From: Olaf Hering Date: Fri, 1 Apr 2016 14:26:36 +0200 Message-Id: <1459513596-4362-1-git-send-email-olaf@aepfle.de> Subject: [Qemu-devel] [PATCH v2] 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 --- 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 + #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