[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/17] configure: clean up PIE option handling
|
From: |
Paolo Bonzini |
|
Subject: |
[PATCH 10/17] configure: clean up PIE option handling |
|
Date: |
Mon, 16 Oct 2023 08:31:20 +0200 |
Keep together all the conditions that lead to disabling PIE.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 35 ++++++++++++++---------------------
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/configure b/configure
index 7dad78f329b..a713493e9e2 100755
--- a/configure
+++ b/configure
@@ -373,17 +373,6 @@ else
targetos=bogus
fi
-# OS specific
-
-case $targetos in
-windows)
- pie="no"
-;;
-haiku)
- pie="no"
-;;
-esac
-
if test ! -z "$cpu" ; then
# command line argument
:
@@ -1084,19 +1073,23 @@ static THREAD int tls_var;
int main(void) { return tls_var; }
EOF
-if test "$static" = "yes"; then
- if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie";
then
+if test "$targetos" = windows || test "$targetos" = haiku; then
+ if test "$pie" = "yes"; then
+ error_exit "PIE not available due to missing OS support"
+ fi
+ pie=no
+fi
+
+if test "$pie" != "no"; then
+ if test "$static" = "yes"; then
+ pie_ldflags=-static-pie
+ else
+ pie_ldflags=-pie
+ fi
+ if compile_prog "-Werror -fPIE -DPIE" "$pie_ldflags"; then
pie="yes"
elif test "$pie" = "yes"; then
error_exit "-static-pie not available due to missing toolchain support"
- else
- pie="no"
- fi
-elif test "$pie" != "no"; then
- if compile_prog "-Werror -fPIE -DPIE" "-pie"; then
- pie="yes"
- elif test "$pie" = "yes"; then
- error_exit "PIE not available due to missing toolchain support"
else
echo "Disabling PIE due to missing toolchain support"
pie="no"
--
2.41.0
- Re: [PATCH 03/17] meson, cutils: allow non-relocatable installs, (continued)
- [PATCH 01/17] meson: do not build shaders by default, Paolo Bonzini, 2023/10/16
- [PATCH 05/17] hw/xen: cleanup sourcesets, Paolo Bonzini, 2023/10/16
- [PATCH 04/17] configure: clean up handling of CFI option, Paolo Bonzini, 2023/10/16
- [PATCH 08/17] configure, tests/tcg: simplify GDB conditionals, Paolo Bonzini, 2023/10/16
- [PATCH 07/17] tests/tcg/arm: move non-SVE tests out of conditional, Paolo Bonzini, 2023/10/16
- [PATCH 10/17] configure: clean up PIE option handling,
Paolo Bonzini <=
- [PATCH 06/17] hw/remote: move stub vfu_object_set_bus_irq out of stubs/, Paolo Bonzini, 2023/10/16
- [PATCH 09/17] configure: clean up plugin option handling, Paolo Bonzini, 2023/10/16
- [PATCH 11/17] configure: remove some dead cruft, Paolo Bonzini, 2023/10/16
- [PATCH 12/17] configure: move target-specific defaults to an external machine file, Paolo Bonzini, 2023/10/16
- [PATCH 14/17] configure: unify handling of several Debian cross containers, Paolo Bonzini, 2023/10/16
- [PATCH 15/17] configure, meson: use command line options to configure qemu-ga, Paolo Bonzini, 2023/10/16
- [PATCH 16/17] meson-buildoptions: document the data at the top, Paolo Bonzini, 2023/10/16
- [PATCH 17/17] meson: add a note on why we use config_host for program paths, Paolo Bonzini, 2023/10/16
- [PATCH 13/17] configure: move environment-specific defaults to config-meson.cross, Paolo Bonzini, 2023/10/16