From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48672C5DF60 for ; Fri, 8 Nov 2019 18:52:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16C3B214DB for ; Fri, 8 Nov 2019 18:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239129; bh=USMjmXUw22LlFO1YGkbIfAKSOwExD4n4ycItUQoQCHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ak1IPYtpjktCfmk+q/A0elSx1/a418PqUphp5FBMZ1gisZH9NDayS6cRYOxBRY5HM 4Li047cQBXeCWzjoP6yLuNi7/iekDStzXFer6oYTQf6/zR41xDkd6Fpxz3UaleUlsO IZkIob5uG3QecUrMLFwjHAP/ls6v+iIfgi4WSEaE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730319AbfKHSwI (ORCPT ); Fri, 8 Nov 2019 13:52:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:48282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbfKHSwH (ORCPT ); Fri, 8 Nov 2019 13:52:07 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC65D2087E; Fri, 8 Nov 2019 18:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239127; bh=USMjmXUw22LlFO1YGkbIfAKSOwExD4n4ycItUQoQCHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cHKxqwHkS8MET/ZAfk+D1qzwWuR6iQ06bo8151j5TNCak0FflwcnbXBtGNogTLPo2 AB/C45mn1hP2L6bxohgu3o1tcZDRDowikYg5LUr+XY9eDh9pI4wF3RKR3A/LNzkjDd 9JPCg3hx9yTVE+WIyoSG7i8+jYNBSwbeDsxTSsaA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Seth Forshee , Masahiro Yamada , Sasha Levin Subject: [PATCH 4.4 01/75] kbuild: add -fcf-protection=none when using retpoline flags Date: Fri, 8 Nov 2019 19:49:18 +0100 Message-Id: <20191108174708.947436520@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174708.135680837@linuxfoundation.org> References: <20191108174708.135680837@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Seth Forshee [ Upstream commit 29be86d7f9cb18df4123f309ac7857570513e8bc ] The gcc -fcf-protection=branch option is not compatible with -mindirect-branch=thunk-extern. The latter is used when CONFIG_RETPOLINE is selected, and this will fail to build with a gcc which has -fcf-protection=branch enabled by default. Adding -fcf-protection=none when building with retpoline enabled prevents such build failures. Signed-off-by: Seth Forshee Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 6b09890b170cd..43d0a98a9fe60 100644 --- a/Makefile +++ b/Makefile @@ -823,6 +823,12 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes) # Prohibit date/time macros, which would make the build non-deterministic KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) +# ensure -fcf-protection is disabled when using retpoline as it is +# incompatible with -mindirect-branch=thunk-extern +ifdef CONFIG_RETPOLINE +KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) +endif + # use the deterministic mode of AR if available KBUILD_ARFLAGS := $(call ar-option,D) -- 2.20.1