From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Thomas Huth" <thuth@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: Supporting clang on windows
Date: Mon, 25 Nov 2024 09:34:15 +0000 [thread overview]
Message-ID: <Z0REl6xtaYuvP876@redhat.com> (raw)
In-Reply-To: <CABgObfbpEEHbLYNNXoNUwD0VNPiNAYB-9REqgEFhRz3QQKTZYw@mail.gmail.com>
On Mon, Nov 25, 2024 at 08:00:00AM +0100, Paolo Bonzini wrote:
> On Sun, Nov 24, 2024 at 9:23 PM Pierrick Bouvier
> <pierrick.bouvier@linaro.org> wrote:
> > -mms-bitfields is already the (silent) gcc default on windows, to mimic
> > MSVC behaviour. Yes, it would be preferable to use this default and
> > gcc_struct attribute, but right now, it does not work with clang. So the
> > whole point is to accept a compromise for this.
> > I don't understand the strong pushback against clang support on windows.
> > Because of a "theoretical" problem, that was proved here we don't have
> > currently, we are stuck with gcc_struct attribute.
>
> I think you are unnecessarily pessimistic:
>
> * there is no need for a compromise, eliminating gcc_struct is the
> best solution but it needs proof that it introduces no guest-visible
> changes
>
> * there is no pushback against clang support, there is pushback
> against asking for a change without understanding the problem
To expand on this...
Bear in mind that when stuff breaks, users file bugs, and the QEMU
maintainers are on the receiving end of user demands to investigate
and fix the problem.
These kind of issues have the potential to be very hard to debug
and diagnose. Maintainer time is precious, which is why we're
conservative at making decisions that expose us to potential long
term negative consequences / increased workload. Compiling with
flags that were known to be incompatible with our code historically
is a reasonable thing to reject. It should not be unexpected that
when a request to change this has a higher burden of proof that
other proposals.
> clang's lack of support for gcc_struct is stupid, but we have to work
> around it and we can, without introducing potential ABI breaks. Just
> verify that gcc_struct still has any effect. Initially I mentioned
> checking sizeof() but actually it's possible to do the same using
> debug info, similar to your scripts.
IMHO we need to have confidence not only in the current state of the code,
but also that we're not going to accidentally regresss it in the future.
This is what the gcc_struct attribute gives us confidence in.
If we can do an assert with a 'sizeof' check, that would give us similar,
but I presume any sizeof checks need to be manually written to specify
the expected size ? A manual check for pahole output by comparison only
tells us about the current point in time of QEMU code.
As an alternative is it practical for us to eliminate all bitfields
from our structs ? IIUC, we already have the preference that we use
the 'BIT(n)' and 'BIT_ULL(n)' macros for accessing bits from full
sized int32/int64 fields which avoids the semantic layout problems.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-11-25 9:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-24 0:21 Supporting clang on windows Pierrick Bouvier
2024-11-24 12:10 ` Paolo Bonzini
2024-11-24 20:23 ` Pierrick Bouvier
2024-11-25 7:00 ` Paolo Bonzini
2024-11-25 9:34 ` Daniel P. Berrangé [this message]
2024-11-25 9:39 ` Paolo Bonzini
2024-11-25 10:42 ` Peter Maydell
2024-11-25 11:19 ` Thomas Huth
2024-11-25 16:48 ` Pierrick Bouvier
2024-11-25 17:05 ` Peter Maydell
2024-11-25 21:47 ` Pierrick Bouvier
2024-11-26 21:24 ` Pierrick Bouvier
2024-11-25 16:55 ` Pierrick Bouvier
2024-11-25 7:15 ` Thomas Huth
2024-11-24 12:28 ` Philippe Mathieu-Daudé
2024-11-24 20:24 ` Pierrick Bouvier
2024-11-25 6:31 ` Thomas Huth
2024-11-25 14:04 ` Richard Henderson
2024-11-25 16:19 ` Pierrick Bouvier
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=Z0REl6xtaYuvP876@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.