qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.0] configure: use do_cc when checking for -fstack-protector support
@ 2014-04-09 11:04 Peter Maydell
  2014-04-10 16:31 ` Michael S. Tsirkin
  2014-04-11 12:34 ` Alexey Kardashevskiy
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Maydell @ 2014-04-09 11:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Andreas Färber, Steven Noonan, patches

MacOSX clang silently swallows unrecognized -f options when doing a link
with '-framework' also on the command line, so to detect support for
the various -fstack-protector options we must do a plain .c to .o compile,
not a complete compile-and-link.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This should be a pretty safe change and it prevents clang/MacOSX
builds from spewing a warning on every C file compilation, so I'd
like to get it into 2.0.

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index eb0e7bb..c85475f 100755
--- a/configure
+++ b/configure
@@ -1448,7 +1448,7 @@ done
 if test "$stack_protector" != "no" ; then
   gcc_flags="-fstack-protector-strong -fstack-protector-all"
   for flag in $gcc_flags; do
-    if compile_prog "-Werror $flag" "" ; then
+    if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC ; then
       QEMU_CFLAGS="$QEMU_CFLAGS $flag"
       LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
       break
-- 
1.8.5.4

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

end of thread, other threads:[~2014-04-11 15:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 11:04 [Qemu-devel] [PATCH for-2.0] configure: use do_cc when checking for -fstack-protector support Peter Maydell
2014-04-10 16:31 ` Michael S. Tsirkin
2014-04-10 16:37   ` Peter Maydell
2014-04-10 17:51     ` Michael S. Tsirkin
2014-04-10 22:31       ` Peter Maydell
2014-04-11 12:34 ` Alexey Kardashevskiy
2014-04-11 14:24   ` Alexey Kardashevskiy
2014-04-11 14:33     ` Alexey Kardashevskiy
2014-04-11 15:30       ` Peter Maydell

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).