On Fri, 14 Mar 2025 at 15:39, Paolo Bonzini <pbonz...@redhat.com> wrote:
>
> -gsplit-dwarf is reported to produce broken binaries on Windows.
> The linker produces warnings but exits successfully:
>
> /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
>
> and as a result qemu-ga.exe fails to start.
>
> On top of this, also disable -gsplit-dwarf unless building from git.
> Similar to -Werror, split debug info is probably not the best choice
> for people that want to build for installing.
>
> (Random thoughts: there is a tension here between adding an option
> that is useful for QEMU developers, and messing things up for everyone
> else by doing something decidedly non-standard.  For example, distros
> are starting to create a fake git repository just so that they can
> use "git am" to apply patches; while some of them, for example Fedora,
> are wise, or paranoid, enough to pass --disable-XXX for everything and
> then turn back on what they want, it cannot be expected that everyone
> does this.  It may be safer to make --enable-split-debug default off
> for everybody and add it somewhere in docs/.  For now I am keeping it
> enabled but we could consider doing something different during the hard
> freeze period).
>
> Reported-by: Konstantin Kostiuk <kkost...@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
> ---
>  configure         | 4 ++++
>  meson_options.txt | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 02f1dd2311f..9aece67ed08 100755
> --- a/configure
> +++ b/configure
> @@ -1864,6 +1864,10 @@ if test "$skip_meson" = no; then
>        { test "$host_os" = linux || test "$host_os" = "windows"; }; then
>        echo 'werror = true' >> $cross
>    fi
> +  if test -e "$source_path/.git" && test "$host_os" != "windows"; then
> +      echo 'split_debug = true' >> $cross
> +  fi

Same remark as on the other patch: can we have a comment
explaining why we disable this on Windows, please, ideally
with a URL of a bug report against the toolchain ?

thanks
-- PMM

Reply via email to