diff options
author | Olaf Hering <olaf@aepfle.de> | 2016-04-01 12:27:16 +0200 |
---|---|---|
committer | hyokeun <hyokeun.jeon@samsung.com> | 2016-09-06 15:55:36 +0900 |
commit | 6581889c74e00b2071f2b750cf2998d599c30df7 (patch) | |
tree | aabdb61a6ca346e11d7519806d81ea779c1e38a3 | |
parent | 224977682905d4cb45ee00bfafa0ccc7b128d118 (diff) | |
download | qemu-6581889c74e00b2071f2b750cf2998d599c30df7.tar.gz qemu-6581889c74e00b2071f2b750cf2998d599c30df7.tar.bz2 qemu-6581889c74e00b2071f2b750cf2998d599c30df7.zip |
build: link with libatomic on powerpc-linux
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>
-rwxr-xr-x | configure | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -4049,6 +4049,33 @@ if test "$usb_redir" != "no" ; then fi fi +if test "$linux_user" = "no" -a "$cpu" = "ppc" -a "$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 |