All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Volker Rümelin" <vr_qemu@t-online.de>
Cc: Michael Tokarev <mjt@tls.msk.ru>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	 QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: disable-pie build
Date: Sun, 12 Nov 2023 10:13:16 +0100	[thread overview]
Message-ID: <CABgObfZg4WO+zZ-wH5mbwH6f0pVd6AzxXukd_5xdg6TGb8O9hw@mail.gmail.com> (raw)
In-Reply-To: <0f4ace5b-7541-4b88-bdd1-f78aed90d01f@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

Il sab 11 nov 2023, 21:09 Volker Rümelin <vr_qemu@t-online.de> ha scritto:

> No, this doesn't look good. This patch again breaks the native Windows
> build with MSYS2 and mingw64 cross compile probably too.
>

Doh, you're right of course (
https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg05486.html). We
need to add qemu_ldflags by hand to all executable.

I will look into adding no-pie support to Meson natively.

Paolo


> See
>
> https://gitlab.com/qemu-project/qemu/-/issues/1664
>
>
> https://lore.kernel.org/qemu-devel/20230522080816.66320-1-pbonzini@redhat.com/
>
> https://lore.kernel.org/qemu-devel/20230523073029.19549-1-pbonzini@redhat.com/
>
> and the big comment above the changed lines in meson.build.
>
> With best regards,
> Volker
>
> >> /usr/bin/ld: libcommon.fa.p/hw_core_cpu-common.c.o: relocation
> R_X86_64_32 against `.rodata' can not be used when making a PIE object;
> recompile with
> >> -fPIE
> >> /usr/bin/ld: failed to set dynamic section sizes: bad value
> >>
> >> This is failing for *all* executables, including tests, qemu-img, etc.
> >>
> >> The following change fixes it:
> >>
> >> diff --git a/meson.build b/meson.build
> >> index a9c4f28247..0b7ca45d48 100644
> >> --- a/meson.build
> >> +++ b/meson.build
> >> @@ -278,7 +278,8 @@ endif
> >>   # tries to build an executable instead of a shared library and
> fails.  So
> >>   # don't add -no-pie anywhere and cross fingers. :(
> >>   if not get_option('b_pie')
> >> -  qemu_common_flags += cc.get_supported_arguments('-fno-pie',
> '-no-pie')
> >> +  qemu_common_flags += cc.get_supported_arguments('-fno-pie')
> >> +  qemu_ldflags += cc.get_supported_arguments('-no-pie')
> >>   endif
> >>
> >>   if not get_option('stack_protector').disabled()
>
>

[-- Attachment #2: Type: text/html, Size: 3144 bytes --]

  reply	other threads:[~2023-11-12  9:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-11  2:39 disable-pie build Michael Tokarev
2023-11-11 16:09 ` Paolo Bonzini
2023-11-11 20:09   ` Volker Rümelin
2023-11-12  9:13     ` Paolo Bonzini [this message]
2023-11-12 10:22       ` Michael Tokarev
2023-11-12 17:03 ` Paolo Bonzini
2023-11-12 19:11   ` Michael Tokarev

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=CABgObfZg4WO+zZ-wH5mbwH6f0pVd6AzxXukd_5xdg6TGb8O9hw@mail.gmail.com \
    --to=pbonzini@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vr_qemu@t-online.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.