提交 aa527b65 编写于 作者: A Aurelien Jarno

configure: fix compilation on hosts without -fstack-protector-all

Commit a0f291fc 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: NAurelien Jarno <aurelien@aurel32.net>
上级 22574c81
...@@ -140,11 +140,14 @@ LDFLAGS="-g $LDFLAGS" ...@@ -140,11 +140,14 @@ LDFLAGS="-g $LDFLAGS"
gcc_flags="-Wold-style-declaration -Wold-style-definition -fstack-protector-all" gcc_flags="-Wold-style-declaration -Wold-style-definition -fstack-protector-all"
cat > $TMPC << EOF cat > $TMPC << EOF
int main(void) { } int main(void) { return 0; }
EOF EOF
for flag in $gcc_flags; do 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" QEMU_CFLAGS="$flag $QEMU_CFLAGS"
else
echo disable $flag
fi fi
done done
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册