Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5238903imu; Wed, 19 Dec 2018 07:52:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/WsvYq3EV9I8oYo8wmSRl6iFqZPWksKo0IfyZ1jfB8M5Z/6bq9TTC2+6RVDPWCJ/wQTN7z8 X-Received: by 2002:a63:f901:: with SMTP id h1mr19828642pgi.154.1545234721210; Wed, 19 Dec 2018 07:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545234721; cv=none; d=google.com; s=arc-20160816; b=dyH4gTvjFauE6HQVRmWp/Xc5Sgmn+WNgG7D1aV9L/3swLV4OxyN/QNr0LuvIopjpzp nMoHmyQahjtqJ6q2RSOdRmPJhsO5Kcx+x3YSga1mHygWY103NWhOexRm/hoWF33KbBzW OvjrYEURSyty+6qsntiAV7xdmcd8Jfu7h8wXK1uSQWasdupjB+RwVotOYeiDJO5e657F D+lEW3ZWFczLjgbl/XMETvosaYFKJbIaG8ajMFtR44jViBHDlWF26DHNx65Tq36cDgNv o4tRLZrECGpm19qrHrMFspkJOkfD2rDdKV3ry6geWX7EpstLcm4eWiuZmB0WXrPEwjUh efkw== 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 :message-id:date:subject:cc:to:from; bh=rnmcR44yICsFHyUKE4NmUKqsQ08R6F280lRampySkM4=; b=1AYLVrWLnfz4UoVa/8qzc1IpgoJ2YKhhddLgEUoclWB9bXzZ0xObhqDgIV0uyCy2xl uAhKp/VQf3FUKMO+kernbZNnmSe/4K75qmYO6goZ7k63AUmrBytQKAqUv+Fg9icD7S7S 1MR2XPvD/OETa8DbR+77tuFcGJGyYEbDzvRquHRTAS54byE/TOQr3KCge4l5PtOGmOPi oHyokBmzTQnMMErw8XBS5UATgZtoxE4rDHJeJFCAMJjsyxNb2Lw6r2YfW3Vn5it7Kh76 4AWAUeSWDK4ZquVEH0S9o9i7ZSYMWltL9SH2CXzK/015HOeadg6y+4DmermS/WeyyTHF xspw== ARC-Authentication-Results: i=1; mx.google.com; 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 g7si15643897plq.336.2018.12.19.07.51.44; Wed, 19 Dec 2018 07:52:01 -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; 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 S1729310AbeLSORw (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.19.2