aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-04-11 17:13:52 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-04-14 12:11:18 +0100
commit590e5dd98fcc926cc3b63aad35aed79235ca4c2a (patch)
tree9d5a57a54e8fc33220b1f8e0e5ed464898c26e58 /configure
parentf12d048a523780dbda702027d4a91b62af1a08d7 (diff)
configure: Make stack-protector test check both compile and link
Since we use the -fstack-protector argument at both compile and link time in the build, we must check that it works with both a compile and a link: * MacOSX only fails in the compile step, not linking * some gcc cross environments only fail at the link stage (if they require a libssp and it's not present for some reason) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1397232832-32301-1-git-send-email-peter.maydell@linaro.org Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure5
1 files changed, 4 insertions, 1 deletions
diff --git a/configure b/configure
index c85475fb87..69b9f56847 100755
--- a/configure
+++ b/configure
@@ -1448,7 +1448,10 @@ done
if test "$stack_protector" != "no" ; then
gcc_flags="-fstack-protector-strong -fstack-protector-all"
for flag in $gcc_flags; do
- if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC ; then
+ # We need to check both a compile and a link, since some compiler
+ # setups fail only on a .c->.o compile and some only at link time
+ if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC &&
+ compile_prog "-Werror $flag" ""; then
QEMU_CFLAGS="$QEMU_CFLAGS $flag"
LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
break