qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Subject: [PULL 2/5] meson.build: Check for the availability of __attribute__((gcc_struct)) on MSYS2
Date: Fri, 16 Aug 2024 09:22:15 +0200	[thread overview]
Message-ID: <20240816072218.27125-3-thuth@redhat.com> (raw)
In-Reply-To: <20240816072218.27125-1-thuth@redhat.com>

Since quite a while MSYS2 now supports Clang as a compiler, too.
Unfortunately, this compiler is lacking the __attribute__((gcc_struct))
that we need for compiling on Windows. But since the compiler is
available now, some people started to use it to compile QEMU on MSYS2,
apparently ignoring the compiler warnings (see for example the ticket at
https://gitlab.com/qemu-project/qemu/-/issues/2476 ). These builds are
likely broken in a couple of spots, so let's make sure that we rather
bail out early in the configuration phase instead of allowing the build
to succeed with warnings.

Message-ID: <20240815122719.727639-1-thuth@redhat.com>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meson.build b/meson.build
index 81ecd4bae7..fbda17c987 100644
--- a/meson.build
+++ b/meson.build
@@ -315,6 +315,11 @@ elif host_os == 'sunos'
   qemu_common_flags += '-D__EXTENSIONS__'
 elif host_os == 'haiku'
   qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC']
+elif host_os == 'windows'
+  if not compiler.compiles('struct x { int y; } __attribute__((gcc_struct));',
+                           args: '-Werror')
+    error('Your compiler does not support __attribute__((gcc_struct)) - please use GCC instead of Clang')
+  endif
 endif
 
 # __sync_fetch_and_and requires at least -march=i486. Many toolchains
-- 
2.46.0



  parent reply	other threads:[~2024-08-16  7:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16  7:22 [PULL 0/5] Some small tests and s390x fixes Thomas Huth
2024-08-16  7:22 ` [PULL 1/5] target/s390x: fix build warning (gcc-12 -fsanitize=thread) Thomas Huth
2024-08-16  7:45   ` Philippe Mathieu-Daudé
2024-08-16  8:26     ` Thomas Huth
2024-08-16 17:55     ` Pierrick Bouvier
2024-08-16  7:22 ` Thomas Huth [this message]
2024-08-16  7:22 ` [PULL 3/5] tests/avocado: apply proper skipUnless decorator Thomas Huth
2024-08-19 22:31   ` Philippe Mathieu-Daudé
2024-08-20  8:03     ` Thomas Huth
2024-08-20  8:06       ` Thomas Huth
2024-08-16  7:22 ` [PULL 4/5] ci: add gtk-vnc to the deps Thomas Huth
2024-08-16  7:22 ` [PULL 5/5] ci: refresh package lists with lcitool Thomas Huth
2024-08-16 11:50 ` [PULL 0/5] Some small tests and s390x fixes Richard Henderson

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=20240816072218.27125-3-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).