[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/21] meson: move int128 checks from configure
From: |
marcandre . lureau |
Subject: |
[PULL 14/21] meson: move int128 checks from configure |
Date: |
Tue, 22 Mar 2022 16:25:54 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
(note: the test isn't working as intended, the next patches fixes it)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
configure | 47 -----------------------------------------------
meson.build | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 47 deletions(-)
diff --git a/configure b/configure
index cd4946b43ee8..9e9b85147a5f 100755
--- a/configure
+++ b/configure
@@ -2481,41 +2481,6 @@ if compile_prog "" "" ; then
int128=yes
fi
-#########################################
-# See if 128-bit atomic operations are supported.
-
-atomic128=no
-if test "$int128" = "yes"; then
- cat > $TMPC << EOF
-int main(void)
-{
- unsigned __int128 x = 0, y = 0;
- y = __atomic_load(&x, 0);
- __atomic_store(&x, y, 0);
- __atomic_compare_exchange(&x, &y, x, 0, 0, 0);
- return 0;
-}
-EOF
- if compile_prog "" "" ; then
- atomic128=yes
- fi
-fi
-
-cmpxchg128=no
-if test "$int128" = yes && test "$atomic128" = no; then
- cat > $TMPC << EOF
-int main(void)
-{
- unsigned __int128 x = 0, y = 0;
- __sync_val_compare_and_swap_16(&x, y, x);
- return 0;
-}
-EOF
- if compile_prog "" "" ; then
- cmpxchg128=yes
- fi
-fi
-
########################################
# check if ccache is interfering with
# semantic analysis of macros
@@ -2959,18 +2924,6 @@ if test "$have_tsan" = "yes" && test
"$have_tsan_iface_fiber" = "yes" ; then
echo "CONFIG_TSAN=y" >> $config_host_mak
fi
-if test "$int128" = "yes" ; then
- echo "CONFIG_INT128=y" >> $config_host_mak
-fi
-
-if test "$atomic128" = "yes" ; then
- echo "CONFIG_ATOMIC128=y" >> $config_host_mak
-fi
-
-if test "$cmpxchg128" = "yes" ; then
- echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
-fi
-
if test "$rdma" = "yes" ; then
echo "CONFIG_RDMA=y" >> $config_host_mak
echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
diff --git a/meson.build b/meson.build
index 282e7c46505f..85f3f84ec6f8 100644
--- a/meson.build
+++ b/meson.build
@@ -1869,6 +1869,45 @@ config_host_data.set('CONFIG_ATOMIC64', cc.links('''
return 0;
}'''))
+has_int128 = cc.links('''
+ __int128_t a;
+ __uint128_t b;
+ int main (void) {
+ a = a + b;
+ b = a * b;
+ a = a * a;
+ return 0;
+ }''')
+
+config_host_data.set('CONFIG_INT128', has_int128)
+
+if has_int128
+ has_atomic128 = cc.links('''
+ int main(void)
+ {
+ unsigned __int128 x = 0, y = 0;
+ y = __atomic_load(&x, 0);
+ __atomic_store(&x, y, 0);
+ __atomic_compare_exchange(&x, &y, x, 0, 0, 0);
+ return 0;
+ }''')
+
+ config_host_data.set('CONFIG_ATOMIC128', has_atomic128)
+
+ if not has_atomic128
+ has_cmpxchg128 = cc.links('''
+ int main(void)
+ {
+ unsigned __int128 x = 0, y = 0;
+ __sync_val_compare_and_swap_16(&x, y, x);
+ return 0;
+ }
+ ''')
+
+ config_host_data.set('CONFIG_CMPXCHG128', has_cmpxchg128)
+ endif
+endif
+
config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
#include <sys/auxv.h>
int main(void) {
--
2.35.1.273.ge6ebfd0e8cbb
- [PULL 04/21] Drop qemu_foo() socket API wrapper, (continued)
- [PULL 04/21] Drop qemu_foo() socket API wrapper, marcandre . lureau, 2022/03/22
- [PULL 09/21] Move HOST_LONG_BITS to compiler.h, marcandre . lureau, 2022/03/22
- [PULL 05/21] Replace GCC_FMT_ATTR with G_GNUC_PRINTF, marcandre . lureau, 2022/03/22
- [PULL 07/21] compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED, marcandre . lureau, 2022/03/22
- [PULL 06/21] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT, marcandre . lureau, 2022/03/22
- [PULL 10/21] scripts/modinfo-collect: remove unused/dead code, marcandre . lureau, 2022/03/22
- [PULL 08/21] Simplify HOST_LONG_BITS, marcandre . lureau, 2022/03/22
- [PULL 11/21] util: remove needless includes, marcandre . lureau, 2022/03/22
- [PULL 12/21] util: remove the net/net.h dependency, marcandre . lureau, 2022/03/22
- [PULL 13/21] qapi: remove needless include, marcandre . lureau, 2022/03/22
- [PULL 14/21] meson: move int128 checks from configure,
marcandre . lureau <=
- [PULL 15/21] meson: fix CONFIG_ATOMIC128 check, marcandre . lureau, 2022/03/22
- [PULL 16/21] qapi: remove needless include, marcandre . lureau, 2022/03/22
- [PULL 17/21] qga: remove bswap.h include, marcandre . lureau, 2022/03/22
- [PULL 18/21] error: use GLib to remember the program name, marcandre . lureau, 2022/03/22
- [PULL 19/21] tests: remove needless include, marcandre . lureau, 2022/03/22
- [PULL 20/21] Remove trailing ; after G_DEFINE_AUTO macro, marcandre . lureau, 2022/03/22
- [PULL 21/21] qapi: remove needless include, marcandre . lureau, 2022/03/22
- Re: [PULL 00/21] Fixes patches, Peter Maydell, 2022/03/22