From patchwork Mon Feb 12 08:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 10211963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8E07860329 for ; Mon, 12 Feb 2018 08:27:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77B6F287EF for ; Mon, 12 Feb 2018 08:27:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B9BC28B96; Mon, 12 Feb 2018 08:27:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4C90287EF for ; Mon, 12 Feb 2018 08:27:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932804AbeBLI1R (ORCPT ); Mon, 12 Feb 2018 03:27:17 -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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 #