qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Konstantin Kostiuk" <kkostiuk@redhat.com>,
	QEMU <qemu-devel@nongnu.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Yan Vugenfirer" <yvugenfi@redhat.com>
Subject: Re: Cross-compilation artifact is broken
Date: Wed, 12 Mar 2025 14:55:04 +0000	[thread overview]
Message-ID: <Z9GgSFKk28oRwnHw@redhat.com> (raw)
In-Reply-To: <CAFEAcA9+i8kKtWb3Z=ZWKdgJ1puzLdf_ek=oMYRyJX4WXPU5+g@mail.gmail.com>

On Wed, Mar 12, 2025 at 02:47:16PM +0000, Peter Maydell wrote:
> On Wed, 12 Mar 2025 at 14:24, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Wed, Mar 12, 2025 at 02:05:09PM +0000, Daniel P. Berrangé wrote:
> > > On Wed, Mar 12, 2025 at 03:52:45PM +0200, Konstantin Kostiuk wrote:
> > > > Hi All,
> > > >
> > > > I cross-compiled qemu-ga from current master branch
> > > > (825b96dbcee23d134b691fc75618b59c5f53da32) and found strange behavior.
> > > >
> > > > Configure CLI:
> > > > ./configure --disable-docs --disable-system --disable-user
> > > > --cross-prefix=x86_64-w64-mingw32- --enable-guest-agent
> > > > --disable-guest-agent-msi --disable-qga-vss
> > > > Build CLI:
> > > > make -j8 qemu-ga
> > > >
> > > > Linker wrote the following information but exited with 0 code:
> > > >
> > > > /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld:
> > > > qga/qemu-ga.exe:/4: section below image base
> > > > /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld:
> > > > qga/qemu-ga.exe:/24: section below image base
> > > >
> > > > As a result, this binary failed to start on Windows without any details,
> > > > just a message that the application is not compatible. I also tried to run
> > > > it with wine and got the error:
> > > >
> > > > wine: failed to start
> > > > L"Z:\\home\\user\\Documents\\repos\\qemu\\build\\qga\\qemu-ga.exe"
> > > > Application could not be started, or no application associated with the
> > > > specified file.
> > > > ShellExecuteEx failed: Bad EXE format for
> > > > Z:\home\user\Documents\repos\qemu\build\qga\qemu-ga.exe.
> > > >
> > > > I bisected the tree and found the commit that caused the problem:
> > > > https://gitlab.com/qemu-project/qemu/-/commit/563b1a35ed1f1151505d4fe5f723827d1b3fd4bc
> > > >
> > > > Adding --disable-split-debug to the configure CLI fixes the issue.
> > > >
> > > > $ x86_64-w64-mingw32-gcc --version
> > > > x86_64-w64-mingw32-gcc (GCC) 14.2.0
> > > >
> > > > My question is, is this expected behavior or is this a bug?
> > >
> > > Your configure args don't include "--enable-debug", so I would
> > > not have expected -gsplit-dwarf to have been enabled, so I'm
> > > surprised that commit casued a problem.
> >
> > Hmm it appears that the meson  "get_option('debug')" is entirely
> > unconnected to QEMU's --enable-debug configure flag, which I did
> > not realize.
> >
> > IOW, we've got -gsplit-dwarf enabled by default for everyone
> > building QEMU, which feels dubious. IMHO only an explicit
> > --enable-debug configure arg should have triggered it.
> >
> > In addition since its breaking Windows builds, it appears we
> > need to block its usage on Windows.
> 
> Agreed, but also this seems like a bug in the Windows toolchain
> here: if -gsplit-dwarf is valid for Windows then it shouldn't
> produce bad executables, and if it's not valid then the compiler
> should produce an error if it's provided (or ignore it, maybe).

It works for a simple "helloworld.exe" file so is not completely  busted
on Windows. I'm unclear what we do that makes it unhappy in our case....

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	other threads:[~2025-03-12 15:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 13:52 Cross-compilation artifact is broken Konstantin Kostiuk
2025-03-12 14:05 ` Daniel P. Berrangé
2025-03-12 14:10   ` Konstantin Kostiuk
2025-03-12 14:23   ` Daniel P. Berrangé
2025-03-12 14:47     ` Peter Maydell
2025-03-12 14:55       ` Daniel P. Berrangé [this message]
2025-03-12 16:23     ` Alex Bennée
2025-03-14  8:21       ` Konstantin Kostiuk
2025-03-14 10:18         ` Alex Bennée
2025-03-14 14:21     ` Paolo Bonzini
2025-03-14 14:25       ` Daniel P. Berrangé

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=Z9GgSFKk28oRwnHw@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=kkostiuk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yvugenfi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).