mbox series

[v3,0/3] Enable clang build on Windows

Message ID 20241128201510.869974-1-pierrick.bouvier@linaro.org
Headers show
Series Enable clang build on Windows | expand

Message

Pierrick Bouvier Nov. 28, 2024, 8:15 p.m. UTC
For now, it was only possible to build plugins using GCC on Windows. However,
windows-aarch64 only supports Clang.
This biggest roadblock was to get rid of gcc_struct attribute, which is not
supported by Clang. After investigation, we proved it was safe to drop it.

Built and tested on Windows (all msys env)/Linux/MacOS for x86_64 and aarch64
hosts.

v1 contained warning fixes and various bits that have been upstreamed already.
The only bits left in this series are the gcc_struct removal, and fixing the
plugins build with clang.

This series is for 10.0, as we decided to not include the gcc_struct removal is
9.2 release.

v1: https://patchew.org/QEMU/20241031040426.772604-1-pierrick.bouvier@linaro.org/

v2:
- drop attribute gcc_struct instead of using -mno-ms-bitfields option
- add a section about bitfields in documentation

v3:
- explain why gcc_struct attribute matters in packed structs in commit message
- reword the bitfields documentation with suggestions given

Pierrick Bouvier (3):
  win32: remove usage of attribute gcc_struct
  docs/devel/style: add a section about bitfield, and disallow them for
    packed structures
  plugins: enable linking with clang/lld

 docs/devel/style.rst                      | 20 +++++++++++++++++++
 meson.build                               |  6 +++---
 include/qemu/compiler.h                   |  7 +------
 scripts/cocci-macro-file.h                |  6 +-----
 subprojects/libvhost-user/libvhost-user.h |  6 +-----
 contrib/plugins/meson.build               |  2 +-
 plugins/meson.build                       | 24 +++++++++++++++++++----
 tests/tcg/plugins/meson.build             |  3 +--
 8 files changed, 48 insertions(+), 26 deletions(-)

Comments

Pierrick Bouvier Dec. 9, 2024, 6:34 p.m. UTC | #1
Hi all,

On 11/28/24 12:15, Pierrick Bouvier wrote:
> For now, it was only possible to build plugins using GCC on Windows. However,
> windows-aarch64 only supports Clang.
> This biggest roadblock was to get rid of gcc_struct attribute, which is not
> supported by Clang. After investigation, we proved it was safe to drop it.
> 
> Built and tested on Windows (all msys env)/Linux/MacOS for x86_64 and aarch64
> hosts.
> 
> v1 contained warning fixes and various bits that have been upstreamed already.
> The only bits left in this series are the gcc_struct removal, and fixing the
> plugins build with clang.
> 
> This series is for 10.0, as we decided to not include the gcc_struct removal is
> 9.2 release.
> 
> v1: https://patchew.org/QEMU/20241031040426.772604-1-pierrick.bouvier@linaro.org/
> 
> v2:
> - drop attribute gcc_struct instead of using -mno-ms-bitfields option
> - add a section about bitfields in documentation
> 
> v3:
> - explain why gcc_struct attribute matters in packed structs in commit message
> - reword the bitfields documentation with suggestions given
> 
> Pierrick Bouvier (3):
>    win32: remove usage of attribute gcc_struct
>    docs/devel/style: add a section about bitfield, and disallow them for
>      packed structures
>    plugins: enable linking with clang/lld
> 
>   docs/devel/style.rst                      | 20 +++++++++++++++++++
>   meson.build                               |  6 +++---
>   include/qemu/compiler.h                   |  7 +------
>   scripts/cocci-macro-file.h                |  6 +-----
>   subprojects/libvhost-user/libvhost-user.h |  6 +-----
>   contrib/plugins/meson.build               |  2 +-
>   plugins/meson.build                       | 24 +++++++++++++++++++----
>   tests/tcg/plugins/meson.build             |  3 +--
>   8 files changed, 48 insertions(+), 26 deletions(-)
> 

gentle ping for this series, so it can be integrated when the trunk will 
be reopened after the release.

Patches 2 (has all the changes requested before) and 3 need review.

Thanks,
Pierrick