SHA256
1
0
forked from pool/qemu
qemu/0042-build-link-with-libatomic-on-powerp.patch
Olaf Hering 7adb207e17 Accepting request 383004 from home:olh:qemu
- Update to v2.6.0-rc0: See http://wiki.qemu-project.org/ChangeLog/2.6
* Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.6
* Accept every size in DISCARD request from a guest (bsc#964427)
  0039-block-split-large-discard-requests-.patch
* Recognize libxl flag to disable flush in block device (bsc#879425)
  0040-xen_disk-Add-suse-specific-flush-di.patch
* Use correct flag for crypto tests
  0041-tests-Use-correct-config-param-for-.patch
* Fix build on powerpc:
  0042-build-link-with-libatomic-on-powerp.patch
* Patches dropped (upstreamed):
  seabios_checkrom_typo.patch
  seabios_avoid_smbios_signature_string.patch

OBS-URL: https://build.opensuse.org/request/show/383004
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=289
2016-04-05 13:18:15 +00:00

54 lines
1.5 KiB
Diff

From 014f615b4a8e48ab8b9630b297e1e4283c9de623 Mon Sep 17 00:00:00 2001
From: Olaf Hering <olaf@aepfle.de>
Date: Fri, 1 Apr 2016 12:27:16 +0200
Subject: [PATCH] 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>
---
configure | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/configure b/configure
index 81caff6..2589044 100755
--- a/configure
+++ b/configure
@@ -4025,6 +4025,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