Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp434508imu; Wed, 12 Dec 2018 20:48:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/WiO0CeBkM3BZc4sdT0yCz1h7YoLq6anrfq26zmEZsp6HotqDIWLGjZTLUwImtRDs3XAbdB X-Received: by 2002:a63:5c41:: with SMTP id n1mr2107280pgm.1.1544676522057; Wed, 12 Dec 2018 20:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544676522; cv=none; d=google.com; s=arc-20160816; b=j78jcvl881yzux+JFq3tUXrDJnxt/cGVG7gJnN4Z6tmk9hHlbLO7+xZmHOEkOxov2I Hz099HM4pbKgK61BCEgcJb9G/eEOg/zpnEhD89MwKpVSSNnupCOlk0Mw7nb2+OalL1GH v37GFfyjFcroLd4428WGN7Sqni95sZjDW+BlJnV6DA3o0UkZrJ1+VVc4IeG3RvrXFpRz fl6R9iB5YhPId9Y6x5qELonyS/dyPBo4P229Ev57MwG+R1XrnzocgxAIkV838+FtqRxc n6Yk5JIwKGugcH/SmOXQNkvc+01tyFAG3gdpYn/1YVdsXDy/py+TExGS78oP2xKFf3BQ +LRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0NdMOfQfI5Y74HmNjusBl+lYDlflrFUzgyYSkMD+0p8=; b=TCFgNawYikdvSL2nr5QQVC8nVjqL+dblg1/CsMRM9S/+I+QIY5tS26Tlxf/GIz0DU3 Y9wSLk0EU69hhABGPLLQUcpX67668dEW0RBoo/Tbw1vXy9Y0a2IwRmRbztXbnkkXt6wV UwS52wZX4GLCKhB0Th/EE9GhmCE05VOqlZ6Zjn22LttGGqfSkpRgS9mVTxkN+K3S+Dao oP9qgEzgUFQXPeVkV8Y5bpVjWLqoLdaf1ZpfcQeMyeEZ6fQZ0NIUdVBz1kZqP5sbDiL+ NEjjxSv4WXX5kRx3ePwk4zdx3eVYTQ5/D02Qxq/FqCkprNsUWV/BcqlKjGIAq2lKauCx XOQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LfMUTZH2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si679330pgt.155.2018.12.12.20.48.27; Wed, 12 Dec 2018 20:48: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=pass header.i=@kernel.org header.s=default header.b=LfMUTZH2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728739AbeLMEqx (ORCPT + 99 others); Wed, 12 Dec 2018 23:46:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:43360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728271AbeLMEaa (ORCPT ); Wed, 12 Dec 2018 23:30:30 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91E5520880; Thu, 13 Dec 2018 04:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544675429; bh=hPz2H1LwqxCSB1L1gFS7ypqMj4GpL2hKfbGsuxsllpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LfMUTZH2WzTwUPTzgOf21W0MR0BJn9v8NPuO6S4oEYSOfLC00o9EDvbpal2q8d7Q5 m7py4c0wC5+11ujKHO73AuAByvKaGnPcmtO478tH2TNJOuj6z8nI/rhRtpvCKt9juk Qj2eba5Jm+4jIiXirgIo1sDdfuB3mI33ZDkN2ZfU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Masahiro Yamada , Borislav Petkov , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Zhenzhong Duan , Ingo Molnar , Sasha Levin Subject: [PATCH AUTOSEL 4.19 58/73] x86/build: Fix compiler support check for CONFIG_RETPOLINE Date: Wed, 12 Dec 2018 23:28:23 -0500 Message-Id: <20181213042838.75160-58-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181213042838.75160-1-sashal@kernel.org> References: <20181213042838.75160-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 25896d073d8a0403b07e6dec56f58e6c33678207 ] 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 this commit did: 829fe4aa9ac1 ("x86: Allow generating user-space headers without a compiler") Reported-by: Meelis Roos Tested-by: Meelis Roos Signed-off-by: Masahiro Yamada Acked-by: Zhenzhong Duan Cc: Borislav Petkov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Zhenzhong Duan Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Link: http://lkml.kernel.org/r/1543991239-18476-1-git-send-email-yamada.masahiro@socionext.com Link: https://lkml.org/lkml/2018/12/4/206 Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- arch/x86/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 9298f0f3817a..b84f61bc5e7a 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -223,9 +223,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 @@ -303,6 +300,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.19.1