From patchwork Mon Dec 30 21:37:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Rientjes X-Patchwork-Id: 3421071 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BD7EF9F295 for ; Mon, 30 Dec 2013 21:38:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22BC3200F0 for ; Mon, 30 Dec 2013 21:38:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 829F7200FE for ; Mon, 30 Dec 2013 21:38:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755518Ab3L3ViA (ORCPT ); Mon, 30 Dec 2013 16:38:00 -0500 Received: from mail-yh0-f50.google.com ([209.85.213.50]:33843 "EHLO mail-yh0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756124Ab3L3Vh7 (ORCPT ); Mon, 30 Dec 2013 16:37:59 -0500 Received: by mail-yh0-f50.google.com with SMTP id b6so2456465yha.23 for ; Mon, 30 Dec 2013 13:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version:content-type; bh=ntERZxPqh8uGJttQ8tDRnUORXc91kLh5y4rkyalxveE=; b=OySd0DBEHKUBuJ5w4Dml7zFTjO7bIeYpZ+wxHqDBH4Rj4zG/Zgd3Xdrq04IwTU9LQq 4Gz+xm+xPnPh6NtKUCqUj3pR4X/lNBXaF3R0+odWV27w6mPp/M1YTWnSYA0F2Fgg5ReO qnYD98QBGWJdfL+YkQyCsAmMvasc7x5LQ5VKbdslVjhfiqSmjvkBJI35+y2/wliXGY7z vKBK98C5wvSv+LopXblgJ+Hu+EwQVFNwfJBJzLkjMT+JWg3r1lnYVf8F6YA0ikqK85eC 9UKUOWRHOG71gx8SkWcVRltrOoAzYCcKDfDlS3EvPI0b2jO2Q3s2QL7COpSnLOfmWRxy tPyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=ntERZxPqh8uGJttQ8tDRnUORXc91kLh5y4rkyalxveE=; b=f1W/K13R0ld1KUADHP/GJk3jjhsgClfpKdGYmalGTD1B9B+hUDxSUbfwb8/2yCRTVb eoS/otLfa180RAxL4t6zKVacMMp6WPQ1p+Sh0jV2i9aHiqZ9fzKfq4CQFmhGtmGInKuZ zOrTCe/k4Q+qLuil+YAnvAar9NTZrfe1zQYN8SsdWs0TaWZH/s9dNl4ZnsAJ22J7G9bY OSv/+uX5iB7CxG5Yuq7JrTe0UKf1tY8SB/eO8ufFmZxJJmI+9rFSEvEyPRsLIvcR+DNH N8i49SS6zBEiuZDoE3tsM8CKEOhzLy7z/hknurPPbCwjwBPFKCyKcGfHBagD3N63drE4 AnkQ== X-Gm-Message-State: ALoCoQlSP5BA9Oy/iNdjotgZXAqYqIU+JpCD1nXdexKC9nnNHa4mZCoF5IYbjFhPO4sHQiHW8w7wO2cTxauuUMdYDzksAvkT//YVAhacCdk7K07u2C+elYHcDD+sYqLZmCx7kY4Ch9GFFw9mgBRb9/h5n/NXqs9/rp+BabmDpBEYRrTvsemjSl9kcshKzTJLkX4gzGLB4vr95eYVB76EiVrY89kwbkZykg== X-Received: by 10.236.24.196 with SMTP id x44mr1309227yhx.92.1388439478000; Mon, 30 Dec 2013 13:37:58 -0800 (PST) Received: from [2620:0:1008:1101:be30:5bff:fed8:5e64] ([2620:0:1008:1101:be30:5bff:fed8:5e64]) by mx.google.com with ESMTPSA id f78sm63296896yhp.12.2013.12.30.13.37.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Dec 2013 13:37:57 -0800 (PST) Date: Mon, 30 Dec 2013 13:37:54 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Ingo Molnar cc: Linus Torvalds , peterz@infradead.org, Andrew Morton , linux@arm.linux.org.uk, ralf@linux-mips.org, tglx@linutronix.de, "H. Peter Anvin" , linux-kernel@vger.kernel.org, arjan@linux.intel.com, james.hogan@imgtec.com, Michal Marek , lethal@linux-sh.org, shawn.guo@linaro.org, Kees Cook , sfr@canb.auug.org.au, linux-kbuild@vger.kernel.org, linux-tip-commits@vger.kernel.org Subject: [patch core/stackprotector] stackprotector: Fix build when compiler lacks support In-Reply-To: Message-ID: References: <1387481759-14535-3-git-send-email-keescook@chromium.org> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 8779657d29c0 ("stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG") causes the build to break when the compiler doesn't support -fstack-protector-strong: cc1: error: unrecognized command line option ‘-fstack-protector-strong’ cc1: error: unrecognized command line option ‘-fstack-protector-strong’ with at least gcc 4.6.3. Instead of breaking the build, just warn of the failure and disable the feature. Signed-off-by: David Rientjes --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -603,10 +603,11 @@ ifdef CONFIG_CC_STACKPROTECTOR_REGULAR -fstack-protector not supported by compiler)) endif else ifdef CONFIG_CC_STACKPROTECTOR_STRONG - stackp-flag := -fstack-protector-strong - ifeq ($(call cc-option, $(stackp-flag)),) + ifeq ($(call cc-option, -fstack-protector-strong),) $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \ -fstack-protector-strong not supported by compiler) + else + stackp-flag := -fstack-protector-strong endif else # Force off for distro compilers that enable stack protector by default.