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

Alex Bennée posted 30 patches 3 years, 4 months ago
[PATCH v2 18/30] configure: explicitly set cflags for --disable-pie
Posted by Alex Bennée 3 years, 4 months ago
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(+)

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
-- 
2.34.1


Re: [PATCH v2 18/30] configure: explicitly set cflags for --disable-pie
Posted by Richard Henderson 3 years, 4 months ago
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~