On Fri, Nov 01, 2024 at 09:41:01PM +0000, Roque Arcudia Hernandez wrote:
> This contains a series of small compiler fixes to enable the compilation
> of qemu using clang-cl.
> 
> It mainly involves adding some missing header files and updating #ifdefs
> to handle clang-cl specific things.
> 
> Signed-off-by: Erwin Jansen <jans...@google.com>
> Signed-off-by: Roque Arcudia Hernandez <roq...@google.com>
> ---
>  include/qemu/compiler.h   | 3 ++-
>  include/sysemu/dma.h      | 2 ++
>  include/sysemu/os-win32.h | 2 +-
>  migration/savevm.c        | 2 ++
>  tests/qtest/libqtest.c    | 2 +-
>  5 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index c06954ccb4..7f532fe660 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -22,7 +22,8 @@
>  #define QEMU_EXTERN_C extern
>  #endif
>  
> -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
> +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) && \
> +    !defined(__clang__)
>  # define QEMU_PACKED __attribute__((gcc_struct, packed))
>  #else
>  # define QEMU_PACKED __attribute__((packed))

We must use the 'gcc_struct' format for packing on Windows
to preserve the correct ABI.

clang doesn't support this yet, which is why we don't permit
use of clang on Windows platforms at this time.


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 :|


Reply via email to