Blob Blame History Raw
From: Miroslav Benes <mbenes@suse.cz>
Date: Wed, 1 Sep 2021 11:24:20 +0200
Subject: Revert "Revert "kbuild: use -flive-patching when CONFIG_LIVEPATCH is
 enabled""
Patch-mainline: Never, SUSE-specific
References: bsc#1190003 jsc#SLE-17360

This reverts commit 318af7b80b6a6751520cf2b71edb8c45abb9d9d8.

We need the GCC option to safely prepare live patches. We can also track
the objtool unreachable warnings and the other arguments in the commit's
changelog do not apply to SLE15-SP4.

Signed-off-by: Miroslav Benes <mbenes@suse.cz>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 61741e9d9c6e..a15b9a4c2588 100644
--- a/Makefile
+++ b/Makefile
@@ -923,6 +923,10 @@ KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
 LDFLAGS_vmlinux += --gc-sections
 endif
 
+ifdef CONFIG_LIVEPATCH
+KBUILD_CFLAGS += $(call cc-option, -flive-patching=inline-clone)
+endif
+
 ifdef CONFIG_SHADOW_CALL_STACK
 CC_FLAGS_SCS	:= -fsanitize=shadow-call-stack
 KBUILD_CFLAGS	+= $(CC_FLAGS_SCS)