[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/32] configure: clean up PIE option handling
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 24/32] configure: clean up PIE option handling |
|
Date: |
Wed, 18 Oct 2023 10:27:44 +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 688577bebd8..5c1d618f102 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
:
@@ -1088,19 +1077,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
- [PULL 17/32] meson, cutils: allow non-relocatable installs, (continued)
- [PULL 17/32] meson, cutils: allow non-relocatable installs, Paolo Bonzini, 2023/10/18
- [PULL 14/32] tracetool: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 16/32] meson: do not use set10, Paolo Bonzini, 2023/10/18
- [PULL 15/32] meson: do not build shaders by default, Paolo Bonzini, 2023/10/18
- [PULL 19/32] hw/xen: cleanup sourcesets, Paolo Bonzini, 2023/10/18
- [PULL 20/32] hw/remote: move stub vfu_object_set_bus_irq out of stubs/, Paolo Bonzini, 2023/10/18
- [PULL 22/32] configure, tests/tcg: simplify GDB conditionals, Paolo Bonzini, 2023/10/18
- [PULL 21/32] tests/tcg/arm: move non-SVE tests out of conditional, Paolo Bonzini, 2023/10/18
- [PULL 18/32] configure: clean up handling of CFI option, Paolo Bonzini, 2023/10/18
- [PULL 24/32] configure: clean up PIE option handling,
Paolo Bonzini <=
- [PULL 27/32] configure: move environment-specific defaults to config-meson.cross, Paolo Bonzini, 2023/10/18
- [PULL 25/32] configure: remove some dead cruft, Paolo Bonzini, 2023/10/18
- [PULL 29/32] configure, meson: use command line options to configure qemu-ga, Paolo Bonzini, 2023/10/18
- [PULL 23/32] configure: clean up plugin option handling, Paolo Bonzini, 2023/10/18
- [PULL 31/32] meson: add a note on why we use config_host for program paths, Paolo Bonzini, 2023/10/18
- [PULL 28/32] configure: unify handling of several Debian cross containers, Paolo Bonzini, 2023/10/18
- [PULL 30/32] meson-buildoptions: document the data at the top, Paolo Bonzini, 2023/10/18
- [PULL 32/32] configure: define "pkg-config" in addition to "pkgconfig", Paolo Bonzini, 2023/10/18
- [PULL 26/32] configure: move target-specific defaults to an external machine file, Paolo Bonzini, 2023/10/18
- Re: [PULL 00/32] x86 and build system changes for 2023-10-18, Stefan Hajnoczi, 2023/10/18