From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYe5U-0003Xy-1z for qemu-devel@nongnu.org; Fri, 11 Apr 2014 12:13:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYe5T-0006cQ-Cq for qemu-devel@nongnu.org; Fri, 11 Apr 2014 12:13:56 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:47822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYe5T-0006cM-6Y for qemu-devel@nongnu.org; Fri, 11 Apr 2014 12:13:55 -0400 From: Peter Maydell Date: Fri, 11 Apr 2014 17:13:52 +0100 Message-Id: <1397232832-32301-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH for-2.0] configure: Make stack-protector test check both compile and link List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Steven Noonan , patches@linaro.org Since we use the -fstack-protector argument at both compile and link time in the build, we must check that it works with both a compile and a link: * MacOSX only fails in the compile step, not linking * some gcc cross environments only fail at the link stage (if they require a libssp and it's not present for some reason) Signed-off-by: Peter Maydell --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index c85475f..69b9f56 100755 --- a/configure +++ b/configure @@ -1448,7 +1448,10 @@ 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 + # We need to check both a compile and a link, since some compiler + # setups fail only on a .c->.o compile and some only at link time + if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC && + compile_prog "-Werror $flag" ""; then QEMU_CFLAGS="$QEMU_CFLAGS $flag" LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag" break -- 1.9.1