On Thu, Jan 08, 2026 at 12:14:30PM +0100, Philippe Mathieu-Daudé wrote:
> On 8/1/26 11:53, Daniel P. Berrangé wrote:
> > On Thu, Jan 08, 2026 at 11:51:00AM +0100, Philippe Mathieu-Daudé wrote:
> > > On 8/1/26 10:11, Daniel P. Berrangé wrote:
> > > > On Wed, Jan 07, 2026 at 07:05:19PM +0100, Philippe Mathieu-Daudé wrote:
> > > > > Rather than compiling the same content for all targets (unused
> > > > > most of the time, i.e. qemu-system-avr ...), build it once per
> > > > > POSIX hosts. Check Windows host (less likely) before x86 host.
> > > > > 
> > > > > Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
> > > > > ---
> > > > >    dump/win_dump-stubs.c | 21 +++++++++++++++++++++
> > > > >    dump/win_dump.c       | 12 ++++++++----
> > > > >    dump/meson.build      |  6 +++++-
> > > > >    3 files changed, 34 insertions(+), 5 deletions(-)
> > > > >    create mode 100644 dump/win_dump-stubs.c
> > > > 
> > > > snip
> > > > 
> > > > > diff --git a/dump/meson.build b/dump/meson.build
> > > > > index 4277ce9328a..0aaf3f65d9c 100644
> > > > > --- a/dump/meson.build
> > > > > +++ b/dump/meson.build
> > > > > @@ -1,2 +1,6 @@
> > > > >    system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo])
> > > > > -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: 
> > > > > files('win_dump.c'))
> > > > > +if host_os == 'windows'
> > > > > +  system_ss.add(files('win_dump.c'))
> > > > > +else
> > > > > +  system_ss.add(files('win_dump-stubs.c'))
> > > > > +endif
> > > > 
> > > > This is very wrong.
> > > > 
> > > > The win_dump.c  file has no association with Windows hosts. It is about
> > > > creating crash dumps of Windows *guests* in the Windows dump format. The
> > > > current conditional which builds it on TARGET_X86_64 is correct.
> > > 
> > > Great to know this is a *guest* feature and not a *host* one.
> > > 
> > > Something else is currently wrong, because this file is built with
> > > qemu-system-avr on macOS.
> > 
> > Why is that a problem ?
> 
> Single binary can not be linked because each target has these same symbols.

So we need a make 'win_dump_available()' into a runtime check against
the current target == x86, and then unconditionally build the rest of
the file ? How do we provide access to target specific types in such
builds as merely removing the #ifdef shows missing X86CPU / CPUX86State
types for most targets.

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