configure: fix the --enable-static --disable-pie case
The previous tweak was incomplete as it missed a leg.
Fixes: abafb64b6d
(configure: explicitly set cflags for --disable-pie)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20221027183637.2772968-6-alex.bennee@linaro.org>
This commit is contained in:
parent
c3b570b5a9
commit
977cccb845
5
configure
vendored
5
configure
vendored
@ -1327,6 +1327,8 @@ static THREAD int tls_var;
|
|||||||
int main(void) { return tls_var; }
|
int main(void) { return tls_var; }
|
||||||
EOF
|
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 "$static" = "yes"; then
|
||||||
if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then
|
if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then
|
||||||
CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
|
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"
|
error_exit "-static-pie not available due to missing toolchain support"
|
||||||
else
|
else
|
||||||
pie="no"
|
pie="no"
|
||||||
|
QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
|
||||||
fi
|
fi
|
||||||
elif test "$pie" = "no"; then
|
elif test "$pie" = "no"; then
|
||||||
if compile_prog "-Werror -fno-pie" "-no-pie"; then
|
if compile_prog "-Werror -fno-pie" "-no-pie"; then
|
||||||
CONFIGURE_CFLAGS="-fno-pie $CONFIGURE_CFLAGS"
|
CONFIGURE_CFLAGS="-fno-pie $CONFIGURE_CFLAGS"
|
||||||
CONFIGURE_LDFLAGS="-no-pie $CONFIGURE_LDFLAGS"
|
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"
|
QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
|
||||||
fi
|
fi
|
||||||
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
|
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
|
||||||
|
Loading…
Reference in New Issue
Block a user