From patchwork Wed Dec 19 14:17:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miroslav Benes X-Patchwork-Id: 10737293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84C27924 for ; Wed, 19 Dec 2018 14:17:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 740C92B312 for ; Wed, 19 Dec 2018 14:17:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 671DD2B316; Wed, 19 Dec 2018 14:17:58 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 EB9DC2B312 for ; Wed, 19 Dec 2018 14:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729108AbeLSORw (ORCPT ); Wed, 19 Dec 2018 09:17:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:41298 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728426AbeLSORw (ORCPT ); Wed, 19 Dec 2018 09:17:52 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 40BD2AD6F; Wed, 19 Dec 2018 14:17:50 +0000 (UTC) From: Miroslav Benes To: yamada.masahiro@socionext.com, michal.lkml@markovi.net, jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org Cc: pmladek@suse.com, linux-kbuild@vger.kernel.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: [PATCH] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled Date: Wed, 19 Dec 2018 15:17:44 +0100 Message-Id: <20181219141744.32392-1-mbenes@suse.cz> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 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 GCC 9 introduces a new option, -flive-patching. It disables certain optimizations which could make a compilation unsafe for later live patching of the running kernel. The option is used only if CONFIG_LIVEPATCH is enabled and $(CC) supports it. Signed-off-by: Miroslav Benes --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index a0650bf79606..53f5ab810efe 100644 --- a/Makefile +++ b/Makefile @@ -778,6 +778,10 @@ KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,) endif +ifdef CONFIG_LIVEPATCH +KBUILD_CFLAGS += $(call cc-option, -flive-patching=inline-clone) +endif + # arch Makefile may override CC so keep this after arch Makefile is included NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)