From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYcNa-0002oe-KA for qemu-devel@nongnu.org; Fri, 11 Apr 2014 10:24:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYcNU-0002WY-E5 for qemu-devel@nongnu.org; Fri, 11 Apr 2014 10:24:30 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:50507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYcNU-0002WH-6S for qemu-devel@nongnu.org; Fri, 11 Apr 2014 10:24:24 -0400 Received: by mail-pa0-f52.google.com with SMTP id rd3so5465670pab.39 for ; Fri, 11 Apr 2014 07:24:22 -0700 (PDT) Message-ID: <5347FB10.8090502@ozlabs.ru> Date: Sat, 12 Apr 2014 00:24:16 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1397041487-28477-1-git-send-email-peter.maydell@linaro.org> <5347E13C.2050305@ozlabs.ru> In-Reply-To: <5347E13C.2050305@ozlabs.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.0] configure: use do_cc when checking for -fstack-protector support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Steven Noonan , patches@linaro.org On 04/11/2014 10:34 PM, Alexey Kardashevskiy wrote: > 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 >> --- >> 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. This helps. No idea why. Any ideas? :) @@ -1448,7 +1452,7 @@ done if test "$stack_protector" != "no" ; then gcc_flags="-fstack-protector-strong -fstack-protector-all" for flag in $gcc_flags; do - if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC ; then + if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC "" ; then QEMU_CFLAGS="$QEMU_CFLAGS $flag" LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag" break > > > > 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