Received: by 10.223.185.116 with SMTP id b49csp1909379wrg; Mon, 12 Feb 2018 00:31:43 -0800 (PST) X-Google-Smtp-Source: AH8x224Q0tXxShyhpLHitibI/VXlczs/tOKzlYd6joXZs6Ylz02sexbakxek2DSiai7txWiwjg69 X-Received: by 10.99.114.24 with SMTP id n24mr7413997pgc.400.1518424303028; Mon, 12 Feb 2018 00:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518424302; cv=none; d=google.com; s=arc-20160816; b=qSkxreUf/7/RBvOHaj/mUPlMbhaaso+QSwyK++Qut/DCjYu82k1Ynnr6qExftUwUCv JSaC/AWoL94aBhEeTceZwl/WhhQ6oUb1ugKq3k2KJdVPrNyFnD1xgLhwMXNHBn+iIn3V 2q+sbtqBdSu/fMQjusW2l+Z54b47Miy7Yqh8g1fayhVIfsTUyPrDVEbE8uz6dZb+VjAR JCXWNKfXWFAhHIY7wqWJ4Cy1ZqGex/CHyul1R735AM7KsJF99CtCLsJUpcDExmFHAry7 9GhSP9aT418LGth+WrVXnAVGE3RYFjaX7ecWOU3waQTuMU7hQbpPEVHDw8hq3/PqVcT8 /M1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=m1U0ubIbidKuQwt3Fk+KSzcz5FjBC6KWmu5UmnfNVBs=; b=Uxvrr2p1qwOc3gnxRpzQwIQ6M+JXlfphCQ6X7fW4BpDNuG4SjTay+gu8D9uX5uXY2h cp7RUAd15ihCcdfVpxY2tPGrkzRWEqgGz2qmlMv9yB8wuW6iD5s9Flu1iSfaBo5ECPDt baTjJYlOy+a/r9qcrrGwY9Mo834EvWn2bQMRl4Ya+w3z9qsQO7VuXfzIT0YTpFmLXOxC UUrVp+dbAel28cFK5xOwEnIE1mj/0O2uz+zaTjdnjHf/jgl+C3SQihQmk8jB2ZTdsNgq s6ePyk7LBH2L1LEoaO2IeIvr6Zps3CEE10K4ea3MNb5oQWx3K575uQQ9/ER9eFbW5KyC ZWsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=e8gh2NN2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21si4261662pge.393.2018.02.12.00.31.28; Mon, 12 Feb 2018 00:31:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=e8gh2NN2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932858AbeBLI1S (ORCPT + 99 others); Mon, 12 Feb 2018 03:27:18 -0500 Received: from merlin.infradead.org ([205.233.59.134]:41912 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932561AbeBLI1Q (ORCPT ); Mon, 12 Feb 2018 03:27:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=m1U0ubIbidKuQwt3Fk+KSzcz5FjBC6KWmu5UmnfNVBs=; b=e8gh2NN26s9FGj0W6VWRKHxgG mhzH+dtKkY2D9zCVtQfyfwfKMSfW/PA191Oel+eu1s4vK7Bg9SZWD/d8As16Zz1e+Wru/rIi29qpF nSOo8Gx9NAMoGvkbXdSLwQ5NZsn4saFZ37tKquDtt6PptIxvzN2TmBdDD5si9y1XQZVfWcf7gXblt F/XCXcs1TWOyBq4K3m+3bg92Z6xhQzny6329uW//FDgezFXMihbD3w8vAC2ZlrreXvbasmCXnxT2Y vPJCQNaxBGvjis9B3FgjqBDe1gt1D+ttq+SXh+4kUfSG7bziPi1QQpTvaPAXACv9dVpBhdl/3q92h mgKI3a2DA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1el9Re-00028k-S2; Mon, 12 Feb 2018 08:26:39 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D10D120207C93; Mon, 12 Feb 2018 09:26:35 +0100 (CET) Date: Mon, 12 Feb 2018 09:26:35 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: Kees Cook , Ulf Magnusson , Masahiro Yamada , Linux Kbuild mailing list , Greg Kroah-Hartman , Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Sam Ravnborg , Michal Marek , Martin Schwidefsky , Pavel Machek , linux-s390 , Jiri Kosina , Linux Kernel Mailing List , Tejun Heo , Ingo Molnar , "Van De Ven, Arjan" , Arnd Bergmann , Thomas Gleixner Subject: Re: [RFC PATCH 4/7] kconfig: support new special property shell= Message-ID: <20180212082635.GA25314@hirez.programming.kicks-ass.net> References: <20180210080556.mycqsjhxbaguwhay@huvuddator> <20180210085519.737ckf4bcl57h4g2@huvuddator> <20180211103432.pf2ot6nd7nbhdhsy@huvuddator> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 11, 2018 at 10:13:44AM -0800, Linus Torvalds wrote: > That actually sounds like we could just > > (a) make gcc 4.5 be the minimum required version > > (b) actually error out if we find a bad compiler So the unofficial plan was to enforce asm-goto and -fentry support by hard failure to build, which would get us at gcc-4.6 and then remove all the fallback cruft needed for those features -- for x86. If we want to do this tree wide, that's obviously OK with me too ;-) The below is the two force-asm-goto and force-fentry patches folded. --- Makefile | 17 +++++++++++------ arch/x86/Makefile | 25 +++++-------------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index d192dd826cce..1a46f23d0974 100644 --- a/Makefile +++ b/Makefile @@ -489,6 +489,17 @@ KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) endif +# check for 'asm goto' +ifeq ($(shell $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) + CC_HAVE_ASM_GOTO := 1 + KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO + KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO +endif + +ifeq ($(call cc-option-yn, -mfentry), y) + CC_HAVE_FENTRY := 1 +endif + ifeq ($(config-targets),1) # =========================================================================== # *config targets only - make sure prerequisites are updated, and descend @@ -654,12 +665,6 @@ KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) -# check for 'asm goto' -ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) - KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO - KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO -endif - include scripts/Makefile.kcov include scripts/Makefile.gcc-plugins diff --git a/arch/x86/Makefile b/arch/x86/Makefile index fad55160dcb9..35cea458a7be 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -158,27 +158,12 @@ ifdef CONFIG_X86_X32 endif export CONFIG_X86_X32_ABI -# -# If the function graph tracer is used with mcount instead of fentry, -# '-maccumulate-outgoing-args' is needed to prevent a GCC bug -# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42109) -# -ifdef CONFIG_FUNCTION_GRAPH_TRACER - ifndef CONFIG_HAVE_FENTRY - ACCUMULATE_OUTGOING_ARGS := 1 - else - ifeq ($(call cc-option-yn, -mfentry), n) - ACCUMULATE_OUTGOING_ARGS := 1 - - # GCC ignores '-maccumulate-outgoing-args' when used with '-Os'. - # If '-Os' is enabled, disable it and print a warning. - ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE - undefine CONFIG_CC_OPTIMIZE_FOR_SIZE - $(warning Disabling CONFIG_CC_OPTIMIZE_FOR_SIZE. Your compiler does not have -mfentry so you cannot optimize for size with CONFIG_FUNCTION_GRAPH_TRACER.) - endif +ifndef CC_HAVE_ASM_GOTO + $(error Compiler lacks asm-goto support.) +endif - endif - endif +ifndef CC_HAVE_FENTRY + $(error Compiler lacks -mfentry support.) endif #