qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC] configure: fix clang failure for libatomic
@ 2017-04-25  8:35 Nikunj A Dadhania
  2017-04-25  8:42 ` Peter Maydell
  2017-04-25  9:41 ` Richard Henderson
  0 siblings, 2 replies; 7+ messages in thread
From: Nikunj A Dadhania @ 2017-04-25  8:35 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel, david, rth
  Cc: alex.bennee, nikunj, peter.maydell, pbonzini

Travis builds failure was reported for powernv boot-serial test with
qemu built with clang.

Debugging revealed that CONFIG_ATOMIC64 wasnt getting set for the clang
build because of that atomic operations weren't being used and was
resulting in MTTCG failure in the powernv boot-serial test.

libatomic is required to successfully test atomic64 and atomic128 for
clang. Introduced newer checks for the same. And on failure default to
single threaded tcg support in PPC64.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---

Reference:
https://lists.gnu.org/archive/html/qemu-ppc/2017-04/msg00277.html

---
 configure | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/configure b/configure
index d31a3e8..1e5f7af 100755
--- a/configure
+++ b/configure
@@ -4598,6 +4598,9 @@ int main(void)
 EOF
   if compile_prog "" "" ; then
     atomic128=yes
+  elif compile_prog "" "-latomic" ; then
+     atomic128=yes
+     lib_atomic="-latomic"
   fi
 fi
 
@@ -4628,6 +4631,9 @@ int main(void)
 EOF
 if compile_prog "" "" ; then
   atomic64=yes
+elif compile_prog "" "-latomic" ; then
+  atomic64=yes
+  lib_atomic="-latomic"
 fi
 
 ########################################
@@ -6065,6 +6071,16 @@ if [ "$TARGET_BASE_ARCH" = "" ]; then
   TARGET_BASE_ARCH=$TARGET_ARCH
 fi
 
+if test $atomic64 == "yes" || test $atomic128 == "yes" ; then
+    libs_softmmu="$lib_atomic $libs_softmmu"
+elif test $mttcg == "yes" && test $TARGET_BASE_ARCH == "ppc"; then
+    echo
+    echo "Note: Atomic library (-latomic) not available, falling"
+    echo "      back to single threaded mode by default"
+    echo
+    mttcg=no
+fi
+
 symlink "$source_path/Makefile.target" "$target_dir/Makefile"
 
 upper() {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-04-25  9:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25  8:35 [Qemu-devel] [PATCH RFC] configure: fix clang failure for libatomic Nikunj A Dadhania
2017-04-25  8:42 ` Peter Maydell
2017-04-25  8:58   ` Nikunj A Dadhania
2017-04-25  9:04     ` Peter Maydell
2017-04-25  9:16       ` Nikunj A Dadhania
2017-04-25  9:32         ` Peter Maydell
2017-04-25  9:41 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).