]> git.proxmox.com Git - mirror_qemu.git/commitdiff
configure: fix compilation on hosts without -fstack-protector-all
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 6 Feb 2010 20:22:19 +0000 (21:22 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 6 Feb 2010 20:22:19 +0000 (21:22 +0100)
Commit a0f291fc101a7ab3e40850a329da2cc2f2cd1f2d has enabled
-fstack-protector-all on all targets, as the configure test is bogus.
GCC only emits a warning and not an error if this option is not
supported, so the configure scripts doesn't detect the problem.

This patch changes the configure script to try the various flags
with -Werror in addition to catch the possible warnings.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
configure

index 42ef6287a21572abb136b07e065af109d09f1f3c..6c87a9c9e4da6ffcee9cdad24807a2adc1316909 100755 (executable)
--- a/configure
+++ b/configure
@@ -140,11 +140,14 @@ LDFLAGS="-g $LDFLAGS"
 
 gcc_flags="-Wold-style-declaration -Wold-style-definition -fstack-protector-all"
 cat > $TMPC << EOF
-int main(void) { }
+int main(void) { return 0; }
 EOF
 for flag in $gcc_flags; do
-    if compile_prog "$QEMU_CFLAGS" "$flag" ; then
+    echo $testing $flag
+    if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
        QEMU_CFLAGS="$flag $QEMU_CFLAGS"
+    else
+        echo disable $flag
     fi
 done