All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <andreas.faerber@web.de>,
	"Steven Noonan" <steven@uplinklabs.net>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH for-2.0] configure: use do_cc when checking for -fstack-protector support
Date: Fri, 11 Apr 2014 22:34:04 +1000	[thread overview]
Message-ID: <5347E13C.2050305@ozlabs.ru> (raw)
In-Reply-To: <1397041487-28477-1-git-send-email-peter.maydell@linaro.org>

On 04/09/2014 09:04 PM, Peter Maydell wrote:
> 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
> 

My cross environment fails after this patch on "-fstack-protector-all".
Without the patch, gcc for test program gets additional "-m64 -g
-L/home/alexey/crosslib/qemu-build-lib-fc19/usr/lib64" (the last one is
mine, passed via --extra-ldflags=), fails with an error (below). With the
patch, the configure script thinks everything is fine and fails on "ERROR:
zlib check failed".

Why is this happening? Thanks.



powerpc64-linux-gcc -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef
-Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common
--sysroot=/home/alexey/crosslib/qemu-build-lib-fc19/ -isystem
/home/alexey/crosslib/qemu-build-lib-fc19/usr/include -D__EXCEPTIONS
-D__LONG_DOUBLE_128__ -D__NO_INLINE__ -Wno-redundant-decls
-Wno-missing-prototypes -Wmissing-include-dirs -Wno-system-headers
-Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wold-style-declaration -Wold-style-definition -Wtype-limits -Werror
-fstack-protector-strong -o /tmp/qemu-conf-24556-2284-15038.exe
/tmp/qemu-conf-31026-2284-18135.c -m64 -g
-L/home/alexey/crosslib/qemu-build-lib-fc19/usr/lib64
powerpc64-linux-gcc: error: unrecognized command line option
'-fstack-protector-strong'
powerpc64-linux-gcc -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef
-Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common
--sysroot=/home/alexey/crosslib/qemu-build-lib-fc19/ -isystem
/home/alexey/crosslib/qemu-build-lib-fc19/usr/include -D__EXCEPTIONS
-D__LONG_DOUBLE_128__ -D__NO_INLINE__ -Wno-redundant-decls
-Wno-missing-prototypes -Wmissing-include-dirs -Wno-system-headers
-Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs
-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
-Wold-style-declaration -Wold-style-definition -Wtype-limits -Werror
-fstack-protector-all -o /tmp/qemu-conf-24556-2284-15038.exe
/tmp/qemu-conf-31026-2284-18135.c -m64 -g
-L/home/alexey/crosslib/qemu-build-lib-fc19/usr/lib64
/home/system/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/4.8.0/../../../../powerpc64-linux/bin/ld:
cannot find -lssp_nonshared
/home/system/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/4.8.0/../../../../powerpc64-linux/bin/ld:
cannot find -lssp
collect2: error: ld returned 1 exit status




-- 
Alexey

  parent reply	other threads:[~2014-04-11 12:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-04-11 14:24   ` Alexey Kardashevskiy
2014-04-11 14:33     ` Alexey Kardashevskiy
2014-04-11 15:30       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5347E13C.2050305@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=andreas.faerber@web.de \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steven@uplinklabs.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.