qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	qemu-stable@nongnu.org
Subject: [PULL v3 13/18] meson: ensure -mcx16 is passed when detecting ATOMIC128
Date: Fri, 11 Oct 2024 17:32:21 +0200	[thread overview]
Message-ID: <20241011153227.81770-14-pbonzini@redhat.com> (raw)
In-Reply-To: <20241011153227.81770-1-pbonzini@redhat.com>

Moving -mcx16 out of CPU_CFLAGS caused the detection of ATOMIC128 to
fail, because flags have to be specified by hand in cc.compiles and
cc.links invocations (why oh why??).

Ensure that these tests enable all the instruction set extensions that
will be used to build the emulators.

Fixes: c2bf2ccb266 ("configure: move -mcx16 flag out of CPU_CFLAGS", 2024-05-24)
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 65ea45cef03..e4b2af138da 100644
--- a/meson.build
+++ b/meson.build
@@ -2831,7 +2831,7 @@ config_host_data.set('CONFIG_ATOMIC64', cc.links('''
     __atomic_exchange_n(&x, y, __ATOMIC_RELAXED);
     __atomic_fetch_add(&x, y, __ATOMIC_RELAXED);
     return 0;
-  }'''))
+  }''', args: qemu_isa_flags))
 
 has_int128_type = cc.compiles('''
   __int128_t a;
@@ -2865,7 +2865,7 @@ if has_int128_type
       __atomic_compare_exchange_n(&p[4], &p[5], p[6], 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
       return 0;
     }'''
-  has_atomic128 = cc.links(atomic_test_128)
+  has_atomic128 = cc.links(atomic_test_128, args: qemu_isa_flags)
 
   config_host_data.set('CONFIG_ATOMIC128', has_atomic128)
 
@@ -2874,7 +2874,8 @@ if has_int128_type
     # without optimization enabled.  Try again with optimizations locally
     # enabled for the function.  See
     #   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107389
-    has_atomic128_opt = cc.links('__attribute__((optimize("O1")))' + atomic_test_128)
+    has_atomic128_opt = cc.links('__attribute__((optimize("O1")))' + atomic_test_128,
+                                 args: qemu_isa_flags)
     config_host_data.set('CONFIG_ATOMIC128_OPT', has_atomic128_opt)
 
     if not has_atomic128_opt
@@ -2885,7 +2886,7 @@ if has_int128_type
           __sync_val_compare_and_swap_16(&x, y, x);
           return 0;
         }
-      '''))
+      ''', args: qemu_isa_flags))
     endif
   endif
 endif
-- 
2.46.2



  parent reply	other threads:[~2024-10-11 17:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11 15:32 [PULL v3 00/18] Rust initial PoC + meson changes for 2024-10-07 Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 01/18] Require meson version 1.5.0 Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 02/18] build-sys: Add rust feature option Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 03/18] configure, meson: detect Rust toolchain Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 04/18] rust: add bindgen step as a meson dependency Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 05/18] .gitattributes: add Rust diff and merge attributes Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 06/18] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 07/18] rust: add crate to expose bindings and interfaces Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 08/18] scripts/archive-source: find directory name for subprojects Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 09/18] rust: add utility procedural macro crate Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 10/18] rust: add PL011 device model Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 11/18] meson: fix machine option for x86_version Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 12/18] meson: define qemu_isa_flags Paolo Bonzini
2024-10-11 15:32 ` Paolo Bonzini [this message]
2024-10-11 15:32 ` [PULL v3 14/18] dockerfiles: add a Dockerfile using a nightly Rust toolchain Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 15/18] gitlab-ci: add Rust-enabled CI job Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 16/18] docs: fix invalid footnote syntax Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 17/18] docs: avoid footnotes consisting of just URLs Paolo Bonzini
2024-10-11 15:32 ` [PULL v3 18/18] docs: use consistent markup for footnotes Paolo Bonzini
2024-10-12 10:54 ` [PULL v3 00/18] Rust initial PoC + meson changes for 2024-10-07 Peter Maydell
2024-10-12 14:02   ` Peter Maydell
2024-10-13 17:39     ` Paolo Bonzini
2024-10-14 10:12 ` Peter Maydell
2024-10-14 10:40   ` Peter Maydell
2024-10-14 10:54     ` Manos Pitsidianakis
2024-10-14 10:54     ` Paolo Bonzini
2024-10-14 10:57     ` Daniel P. Berrangé
2024-10-16 10:46 ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241011153227.81770-14-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).