|
From: | Erwin Jansen |
Subject: | Re: QEMU patches for native windows support through clang-cl |
Date: | Thu, 21 Nov 2024 13:42:55 -0800 |
> NB As a general point, we actively block use of clang with Windows
> builds (more strictly in 9.2 now), because it lacks support for the
> 'gcc_struct' annotation that we rely on to guarantee correct ABI for
> structs exposed to guests in particular.
Ah, good point. This is
https://github.com/llvm/llvm-project/issues/24757 for the general
tracking issue, and https://github.com/llvm/llvm-project/pull/71148
for a recent PR that attempts to implement this.
Using -mno-ms-bitfields globally is unsafe because there are probably
Windows API structs that implement it.
One solution is to add `QEMU_BUILD_BUG_ON(sizeof(...) == ...)` to all
structs in QEMU that use bitfields. That will prove very quickly if
there are issues or not.
Paolo
> Many people try to simply remove that #ifdef, mistakenly assuming that
> because the code compiles without warnings, it must be correct. Did
> you have solution for this, as it would be a blocker for enabling
> clang on Windows currently ?
>
> 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 :|
>
[Prev in Thread] | Current Thread | [Next in Thread] |