diff mbox series

[PULL,33/45] configure: check if --no-pie is supported first

Message ID 20190910084349.28817-34-alex.bennee@linaro.org
State New
Headers show
Series testing updates (fixes, upgrades, caching) | expand

Commit Message

Alex Bennée Sept. 10, 2019, 8:43 a.m. UTC
For whatever reason this doesn't trigger normally but because
compile_prog uses QEMU_CFLAGS we end up trying to build a -pie
--no-pie build which confuses compilers on some non-x86 hosts.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>


-- 
2.20.1
diff mbox series

Patch

diff --git a/configure b/configure
index 7860bbc3121..30aad233d17 100755
--- a/configure
+++ b/configure
@@ -2021,6 +2021,12 @@  static THREAD int tls_var;
 int main(void) { return tls_var; }
 
 EOF
+  # check we support --no-pie first...
+  if compile_prog "-Werror -fno-pie" "-no-pie"; then
+    CFLAGS_NOPIE="-fno-pie"
+    LDFLAGS_NOPIE="-nopie"
+  fi
+
   if compile_prog "-fPIE -DPIE" "-pie"; then
     QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
     LDFLAGS="-pie $LDFLAGS"
@@ -2036,11 +2042,6 @@  EOF
       pie="no"
     fi
   fi
-
-  if compile_prog "-Werror -fno-pie" "-nopie"; then
-    CFLAGS_NOPIE="-fno-pie"
-    LDFLAGS_NOPIE="-nopie"
-  fi
 fi
 
 ##########################################