qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/3] configure: add option to disable -fstack-protector flags
@ 2014-01-09 21:55 Steven Noonan
  2014-01-09 21:55 ` [Qemu-devel] [PATCH 2/3] virtfs-proxy-helper.c: fix compile error Steven Noonan
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Steven Noonan @ 2014-01-09 21:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Steven Noonan, Anthony Liguori

From: Steven Noonan <snoonan@amazon.com>

The -fstack-protector flag family is useful for ensuring safety and for
debugging, but has a performance impact. Here's a boot time comparison between
a QEMU build of qemu-system-arm with and without the -fstack-protector-all
flag:

    # WITHOUT -fstack-protector-all
    [root@localhost ~]# systemd-analyze
    Startup finished in 1.744s (kernel) + 11.345s (initrd) + 47.164s (userspace) = 1min 255ms

    # WITH -fstack-protector-all
    [root@localhost ~]# systemd-analyze
    Startup finished in 1.843s (kernel) + 12.262s (initrd) + 1min 3.480s (userspace) = 1min 17.587s

This is a sizable delta, and some users may wish to disable the flag.

Signed-off-by: Steven Noonan <snoonan@amazon.com>
Cc: Anthony Liguori <aliguori@amazon.com>
---
 configure | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 07b6be3..c091cdf 100755
--- a/configure
+++ b/configure
@@ -147,6 +147,7 @@ audio_win_int=""
 cc_i386=i386-pc-linux-gnu-gcc
 libs_qga=""
 debug_info="yes"
+stack_protector="yes"
 
 # Don't accept a target_list environment variable.
 unset target_list
@@ -879,6 +880,10 @@ for opt do
   ;;
   --disable-werror) werror="no"
   ;;
+  --enable-stack-protector) stack_protector="yes"
+  ;;
+  --disable-stack-protector) stack_protector="no"
+  ;;
   --disable-curses) curses="no"
   ;;
   --enable-curses) curses="yes"
@@ -1117,6 +1122,7 @@ echo "  --enable-sparse          enable sparse checker"
 echo "  --disable-sparse         disable sparse checker (default)"
 echo "  --disable-strip          disable stripping binaries"
 echo "  --disable-werror         disable compilation abort on warning"
+echo "  --disable-stack-protector disable GCC-provided stack protection"
 echo "  --disable-sdl            disable SDL"
 echo "  --enable-sdl             enable SDL"
 echo "  --disable-gtk            disable gtk UI"
@@ -1298,9 +1304,11 @@ for flag in $gcc_flags; do
     fi
 done
 
-if compile_prog "-Werror -fstack-protector-all" "" ; then
+if test "$stack_protector" = "yes" ; then
+  if compile_prog "-Werror -fstack-protector-all" "" ; then
     QEMU_CFLAGS="$QEMU_CFLAGS -fstack-protector-all"
     LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,-fstack-protector-all"
+  fi
 fi
 
 # Workaround for http://gcc.gnu.org/PR55489.  Happens with -fPIE/-fPIC and
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-01-13 20:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-09 21:55 [Qemu-devel] [PATCH 1/3] configure: add option to disable -fstack-protector flags Steven Noonan
2014-01-09 21:55 ` [Qemu-devel] [PATCH 2/3] virtfs-proxy-helper.c: fix compile error Steven Noonan
2014-01-09 21:55 ` [Qemu-devel] [PATCH 3/3] Makefile: add bios-256k.bin to BLOBS Steven Noonan
2014-01-09 23:27   ` Peter Maydell
2014-01-09 23:30     ` Noonan, Steven
2014-01-10  9:12       ` Markus Armbruster
2014-01-09 22:30 ` [Qemu-devel] [PATCH 1/3] configure: add option to disable -fstack-protector flags Peter Maydell
2014-01-09 22:40 ` Paolo Bonzini
2014-01-09 23:18   ` Brad Smith
2014-01-09 23:31     ` Noonan, Steven
2014-01-11  2:36     ` Noonan, Steven
2014-01-11  7:46       ` Stefan Weil
2014-01-13 11:53         ` Paolo Bonzini
2014-01-13 20:00           ` [Qemu-devel] [PATCH] " Steven Noonan
2014-01-13 20:27             ` Stefan Weil
2014-01-13 20:38               ` Noonan, Steven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).