summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMarc-André Lureau2013-02-25 23:31:12 +0100
committerAlon Levy2013-04-24 10:47:38 +0200
commit37746c5eacf309fa019ea0fa45f776c36c561457 (patch)
tree95cac1c9110896195b7958705eea5d07decae7c6 /configure
parentutil: move socket_init() to osdep.c (diff)
downloadqemu-37746c5eacf309fa019ea0fa45f776c36c561457.tar.gz
qemu-37746c5eacf309fa019ea0fa45f776c36c561457.tar.xz
qemu-37746c5eacf309fa019ea0fa45f776c36c561457.zip
build-sys: must link with -fstack-protector
It is needed to give that flag to the linker as well, but latest libtool 2.4.2 still swallows that argument, so let's pass it with libtool -Wc argument. qemu-1.4.0/stubs/arch-query-cpu-def.c:6: undefined reference to `__stack_chk_guard' Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure8
1 files changed, 7 insertions, 1 deletions
diff --git a/configure b/configure
index 33d3354ea3..ee2e7e8ad9 100755
--- a/configure
+++ b/configure
@@ -1244,7 +1244,7 @@ fi
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
-gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags"
+gcc_flags="-Wendif-labels $gcc_flags"
gcc_flags="-Wno-initializer-overrides $gcc_flags"
# Note that we do not add -Werror to gcc_flags here, because that would
# enable it for all configure tests. If a configure test failed due
@@ -1263,6 +1263,11 @@ for flag in $gcc_flags; do
fi
done
+if compile_prog "-Werror -fstack-protector-all" "" ; then
+ QEMU_CFLAGS="$QEMU_CFLAGS -fstack-protector-all"
+ LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,-fstack-protector-all"
+fi
+
# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and
# large functions that use global variables. The bug is in all releases of
# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in
@@ -4078,6 +4083,7 @@ else
echo "AUTOCONF_HOST := " >> $config_host_mak
fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
+echo "LIBTOOLFLAGS=$LIBTOOLFLAGS" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak