diff mbox series

[v3,05/26] configure: fix the --enable-static --disable-pie case

Message ID 20221020115209.1761864-6-alex.bennee@linaro.org
State New
Headers show
Series testing/next (docker, avocado, s390x, MAINTAINERS) | expand

Commit Message

Alex Bennée Oct. 20, 2022, 11:51 a.m. UTC
The previous tweak was incomplete as it missed a leg.

Fixes: abafb64b6d (configure: explicitly set cflags for --disable-pie)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Richard Henderson Oct. 20, 2022, 10:09 p.m. UTC | #1
On 10/20/22 21:51, Alex Bennée wrote:
> The previous tweak was incomplete as it missed a leg.
> 
> Fixes: abafb64b6d (configure: explicitly set cflags for --disable-pie)
> Signed-off-by: Alex Bennée<alex.bennee@linaro.org>
> ---
>   configure | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

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

r~
diff mbox series

Patch

diff --git a/configure b/configure
index dd6f58dcde..8c2c4c1a04 100755
--- a/configure
+++ b/configure
@@ -1327,6 +1327,8 @@  static THREAD int tls_var;
 int main(void) { return tls_var; }
 EOF
 
+# 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 "$static" = "yes"; then
   if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then
     CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
@@ -1335,13 +1337,12 @@  if test "$static" = "yes"; then
     error_exit "-static-pie not available due to missing toolchain support"
   else
     pie="no"
+    QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
   fi
 elif test "$pie" = "no"; then
   if compile_prog "-Werror -fno-pie" "-no-pie"; then
     CONFIGURE_CFLAGS="-fno-pie $CONFIGURE_CFLAGS"
     CONFIGURE_LDFLAGS="-no-pie $CONFIGURE_LDFLAGS"
-    # 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.
     QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
   fi
 elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then