From patchwork Fri Apr 11 16:13:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 28289 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 78DBF20822 for ; Fri, 11 Apr 2014 16:13:56 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf18076616yha.7 for ; Fri, 11 Apr 2014 09:13:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=PrUZz2cICO0cV2KZxylC5mNafKdgEjdFZKD4ewdNUjc=; b=my4b8hopk9xNKn9BP/rOBify6NC1F4ECpvn00TwgmMMYw+fjlPno91xEWLZ7k80YdK hbJHxejJHYETSLl+UK4JDgJXLjjEWMbYkH9+yUCBgRhhp7oAgXGlyML+gnS3zY4OuS5L s2+ulcXu/usQfK3Jzr6xMxG95eovNOY+k/aDZe8Z5F4gC9tcYD9T+Riv2jPIFjrcn3tC 73GbanV0D1Fy3MSpBRMNQa7UgVVBKJ8XEYMcPGolh7GvJ5PwGgQHbrwBHIilexvLxMO/ NIFbWOHGW78DtgvOa1p9r11FPKNfGG4AQ+PUlpbjSNVv2TiXTmSB4KsWutPOCJ3HRY2W 7W5g== X-Gm-Message-State: ALoCoQkp+Z4Qx6jjElJQBpaBocxGwhAhYextY2TRrHN0U6k7xdKVD3Yd0aY8/saTeSH4rI1SRNCr X-Received: by 10.58.248.99 with SMTP id yl3mr12639387vec.9.1397232836172; Fri, 11 Apr 2014 09:13:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.197 with SMTP id m63ls1684381qga.58.gmail; Fri, 11 Apr 2014 09:13:56 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr1060939vcd.45.1397232835995; Fri, 11 Apr 2014 09:13:55 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id sc12si1418469veb.25.2014.04.11.09.13.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 09:13:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so5148153veb.0 for ; Fri, 11 Apr 2014 09:13:55 -0700 (PDT) X-Received: by 10.58.187.78 with SMTP id fq14mr20313737vec.9.1397232835879; Fri, 11 Apr 2014 09:13:55 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp68690vcb; Fri, 11 Apr 2014 09:13:55 -0700 (PDT) X-Received: by 10.180.109.231 with SMTP id hv7mr4302276wib.38.1397232835181; Fri, 11 Apr 2014 09:13:55 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id pi1si2853218wjb.160.2014.04.11.09.13.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 11 Apr 2014 09:13:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WYe5Q-0008PS-20; Fri, 11 Apr 2014 17:13:52 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Steven Noonan , Alexey Kardashevskiy Subject: [PATCH for-2.0] configure: Make stack-protector test check both compile and link Date: Fri, 11 Apr 2014 17:13:52 +0100 Message-Id: <1397232832-32301-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Tested-by: Alexey Kardashevskiy --- 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