mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-06 11:09:37 +00:00
configure: check if --no-pie is supported first
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>
This commit is contained in:
parent
50d2dcaddb
commit
412aeacdc7
11
configure
vendored
11
configure
vendored
|
@ -2021,6 +2021,12 @@ static THREAD int tls_var;
|
||||||
int main(void) { return tls_var; }
|
int main(void) { return tls_var; }
|
||||||
|
|
||||||
EOF
|
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
|
if compile_prog "-fPIE -DPIE" "-pie"; then
|
||||||
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
|
QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
|
||||||
LDFLAGS="-pie $LDFLAGS"
|
LDFLAGS="-pie $LDFLAGS"
|
||||||
|
@ -2036,11 +2042,6 @@ EOF
|
||||||
pie="no"
|
pie="no"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if compile_prog "-Werror -fno-pie" "-nopie"; then
|
|
||||||
CFLAGS_NOPIE="-fno-pie"
|
|
||||||
LDFLAGS_NOPIE="-nopie"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
|
|
Loading…
Reference in a new issue