diff mbox series

[v2,18/30] configure: explicitly set cflags for --disable-pie

Message ID 20220914155950.804707-19-alex.bennee@linaro.org
State New
Headers show
Series testing/next pre-PR (testing update and mips deprecation) | expand

Commit Message

Alex Bennée Sept. 14, 2022, 3:59 p.m. UTC
This is working around current limitation of Meson's handling of
--disable-pie.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Richard Henderson Sept. 15, 2022, 8:27 a.m. UTC | #1
On 9/14/22 16:59, Alex Bennée wrote:
> This is working around current limitation of Meson's handling of
> --disable-pie.
> 
> Signed-off-by: Alex Bennée<alex.bennee@linaro.org>
> Cc: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   configure | 6 ++++++
>   1 file changed, 6 insertions(+)

Ah, yes, thanks.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/configure b/configure
index 575dde1c1f..6c169b23b5 100755
--- a/configure
+++ b/configure
@@ -1394,6 +1394,12 @@  else
   pie="no"
 fi
 
+# Meson currently only handles pie as a boolean for now so if we have
+# explicitly disabled PIE we need to extend our cflags because it wont.
+if test "$pie" = "no"; then
+    QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
+fi
+
 # Detect support for PT_GNU_RELRO + DT_BIND_NOW.
 # The combination is known as "full relro", because .got.plt is read-only too.
 if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then