Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9129187imu; Tue, 4 Dec 2018 22:29:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/V6wKzbYzXImOiRED21efZia/tBYjuwuKlVKTL9+d8bZdAdqdlZ8gpMyj9Yai9glGVJKbod X-Received: by 2002:a17:902:2e01:: with SMTP id q1mr3946417plb.97.1543991383263; Tue, 04 Dec 2018 22:29:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543991383; cv=none; d=google.com; s=arc-20160816; b=b/cGPoQLhzNjN2XOduPEWwMeDtBkTIDvMvEFwETlRYoJEM5rEI7Dl4f45tnJ7W4luw gioBohasZXe9IXUrcJaIIRf9qmj/s2EbXPfRuVgE4Ey8ctF+h+XgOhnbFaQLrF+asmLC bZ3C0HjGt9n4Je87mplHkgiwYGA7xHNvH+jC11XTNo7nr7e4fFqckqsafImcIGY0SNSo Y4DG06O1JjBEmmeaAXumJFkrrniFDfGfmzl88ug7fZ66d2dLBtPyszseAtbwDkR3ygAG quc9ifiPymxxfwWbm4g9dAEZVgVXpCL4XK7ClZUQi3xcev/I6rVHm55oDMZopFiyhpzI 98aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=5V1kQuJLlfL8jIPRipgke7K6jkRfgqj+4WAl323IuQw=; b=p1e15GT9k4XGhWh6wEJYR52fzlgHjo5bKJmcHsfWigXKH8e8szNbhqw6LkHLSbWeeo UCQoW3bI5iSW+T5xsJfHK7/GfDDVvXjzmOy4yS7EdjbUpagl9mEyaJhVOL7/4dGU2di3 6EHdydFDftQyKBa/d9/bj4O6F1wBpHP7k+G5ZdP/i2s+GWSp6Rl6ZTQaV6Dd5+yZl86c lb7m6Bo0V1aJIBQXhdckLHWW1miZUwlWh5uXYNgm9OJ1K3epbRtQW2m/bPz/7BGja2MB cS247I8zDKnzdkAQ1vz3V1ZNmq6j/7suXLk9x6lO0lmX5gdQL53EzTLrOp6V+vaBIN8b UcZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JPIO8QMv; 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 k64si17532376pge.7.2018.12.04.22.29.27; Tue, 04 Dec 2018 22:29:43 -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=pass header.i=@nifty.com header.s=dec2015msa header.b=JPIO8QMv; 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 S1726966AbeLEG2y (ORCPT + 99 others); Wed, 5 Dec 2018 01:28:54 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:46909 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbeLEG2y (ORCPT ); Wed, 5 Dec 2018 01:28:54 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id wB56RW7u029816; Wed, 5 Dec 2018 15:27:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com wB56RW7u029816 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1543991253; bh=5V1kQuJLlfL8jIPRipgke7K6jkRfgqj+4WAl323IuQw=; h=From:To:Cc:Subject:Date:From; b=JPIO8QMvb8YJcI0EzQV1WF6JoH4c2ywRBCHpc+F2seN5JYRRBiEN1Wt6LeC1g25zt m97MlQ55YKfAEfGwpMjucQsQeSTXvLp8DX/17HzmrROqelraV597g4Bvh7t9D/kXbr Qnu0SQ8NaSr/bj9Xj8DwcIje7gI843jOCsSV7zLMt5pXfdy8yb6JqYnve9SYIZ1QEC ttov7leDh8Y05vxIly/JVI9YM51pzn+/mWmcg9+mg3by43Sa5K0ZZnrWAfS81nfpu1 umqzhGRmTqLgEsJR+y73LRf+sgIJEULTZyonhtqDoH+gsYnT9JkH4Tsoi5LfUQC4FQ tQlBbR0aY+EqA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Ingo Molnar , Thomas Gleixner , x86@kernel.org Cc: Zhenzhong Duan , Meelis Roos , Masahiro Yamada , "H. Peter Anvin" , Borislav Petkov , linux-kernel@vger.kernel.org Subject: [PATCH v2] x86/build: fix compiler support check for CONFIG_RETPOLINE Date: Wed, 5 Dec 2018 15:27:19 +0900 Message-Id: <1543991239-18476-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is troublesome to add a diagnostic like this to the Makefile parse stage because the top-level Makefile could be parsed with a stale include/config/auto.conf. Once you are hit by the error about non-retpoline compiler, the compilation still breaks even after disabling CONFIG_RETPOLINE. The easiest fix is to move this check to the "archprepare" like commit 829fe4aa9ac1 ("x86: Allow generating user-space headers without a compiler") did. Link: https://lkml.org/lkml/2018/12/4/206 Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Reported-by: Meelis Roos Signed-off-by: Masahiro Yamada --- Changes in v2: - Revive ifdef CONFIG_RETPOLINE surrounding the KBUILD_CFLAGS addition - Rephase the commit log a bit, hoping the cause of the issue will be clearer arch/x86/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index f5d7f41..75ef499 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -220,9 +220,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables # Avoid indirect branches in kernel to deal with Spectre ifdef CONFIG_RETPOLINE -ifeq ($(RETPOLINE_CFLAGS),) - $(error You are building kernel with non-retpoline compiler, please update your compiler.) -endif KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) endif @@ -307,6 +304,13 @@ ifndef CC_HAVE_ASM_GOTO @echo Compiler lacks asm-goto support. @exit 1 endif +ifdef CONFIG_RETPOLINE +ifeq ($(RETPOLINE_CFLAGS),) + @echo "You are building kernel with non-retpoline compiler." >&2 + @echo "Please update your compiler." >&2 + @false +endif +endif archclean: $(Q)rm -rf $(objtree)/arch/i386 -- 2.7.4