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 5CE05C5DF60 for ; Fri, 8 Nov 2019 19:18:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 356AE20674 for ; Fri, 8 Nov 2019 19:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573240725; bh=juIE9O2WkTITwnXcJG4/fb/ZHO3ZRRo7h5kUhivQu6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pj4RK2/r9NpYzU+m7/I4O7KMPBQekGKaG49qSZFuCn8QJH+qGyqSkKEeKO44fW4CP TPyagejugHmSoPGbDk4nHqeR+AUSxw6evtfibapzS/EHWYm9LiGPzC0kygwSOYwnFh F4UvplLC2FLjt0N6J0GK64lGzROSAS0ud0KlNHjE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389566AbfKHTAN (ORCPT ); Fri, 8 Nov 2019 14:00:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:57244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389531AbfKHTAM (ORCPT ); Fri, 8 Nov 2019 14:00:12 -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 589C22178F; Fri, 8 Nov 2019 19:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239606; bh=juIE9O2WkTITwnXcJG4/fb/ZHO3ZRRo7h5kUhivQu6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0bl1Tc5Y62zWxRCmaq9jtJ2g8uG3ottw09CZdCugvUmyZ7FKkW5DS8pJVkflsmhue ifj2KQaLBARGBmovOh7Ed96D3N9cUmc8IlSGChTOmwY5i/4ZFtPUebJunRgXNseReG agd7bkzlXjTrmvjCpsWoNFQ8LcEd1idXP0jvrw8I= 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.14 53/62] kbuild: add -fcf-protection=none when using retpoline flags Date: Fri, 8 Nov 2019 19:50:41 +0100 Message-Id: <20191108174756.304875093@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174719.228826381@linuxfoundation.org> References: <20191108174719.228826381@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 61660387eb34b..52aaa6150099e 100644 --- a/Makefile +++ b/Makefile @@ -843,6 +843,12 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) # change __FILE__ to the relative path from the srctree KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) +# 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