Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2018-12-07 11:43:38 +0100
committerJiri Slaby <jslaby@suse.cz>2018-12-07 13:40:46 +0100
commitfb5fd392fe5943aa5a9b149970e4b448a7465c5c (patch)
tree0943b468cfdd3d0cfddf3a0b162163b35cbf2c21
parent8970eff1d1b9561524368917e3249971bd2ca320 (diff)
x86/build: Fix compiler support check for CONFIG_RETPOLINE
(KMP build).
-rw-r--r--patches.rpmify/x86-build-Fix-compiler-support-check-for-CONFIG_RETP.patch64
-rw-r--r--series.conf1
2 files changed, 65 insertions, 0 deletions
diff --git a/patches.rpmify/x86-build-Fix-compiler-support-check-for-CONFIG_RETP.patch b/patches.rpmify/x86-build-Fix-compiler-support-check-for-CONFIG_RETP.patch
new file mode 100644
index 0000000000..8457c5a4ae
--- /dev/null
+++ b/patches.rpmify/x86-build-Fix-compiler-support-check-for-CONFIG_RETP.patch
@@ -0,0 +1,64 @@
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Wed, 5 Dec 2018 15:27:19 +0900
+Subject: x86/build: Fix compiler support check for CONFIG_RETPOLINE
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
+Git-commit: e739d919a0f5f6ac95cffe32489c9c03be538178
+Patch-mainline: Queued in subsystem maintainer repository
+References: KMP build
+
+It is troublesome to add a diagnostic like this to the Makefile
+parse stage because the top-level Makefile could be parsed with
+a stale include/config/auto.conf.
+
+Once you are hit by the error about non-retpoline compiler, the
+compilation still breaks even after disabling CONFIG_RETPOLINE.
+
+The easiest fix is to move this check to the "archprepare" like
+this commit did:
+
+ 829fe4aa9ac1 ("x86: Allow generating user-space headers without a compiler")
+
+Reported-by: Meelis Roos <mroos@linux.ee>
+Tested-by: Meelis Roos <mroos@linux.ee>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Acked-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Zhenzhong Duan <zhenzhong.duan@oracle.com>
+Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
+Link: http://lkml.kernel.org/r/1543991239-18476-1-git-send-email-yamada.masahiro@socionext.com
+Link: https://lkml.org/lkml/2018/12/4/206
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ arch/x86/Makefile | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/arch/x86/Makefile
++++ b/arch/x86/Makefile
+@@ -223,9 +223,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwin
+
+ # Avoid indirect branches in kernel to deal with Spectre
+ ifdef CONFIG_RETPOLINE
+-ifeq ($(RETPOLINE_CFLAGS),)
+- $(error You are building kernel with non-retpoline compiler, please update your compiler.)
+-endif
+ KBUILD_CFLAGS += $(RETPOLINE_CFLAGS)
+ endif
+
+@@ -303,6 +300,13 @@ ifndef CC_HAVE_ASM_GOTO
+ @echo Compiler lacks asm-goto support.
+ @exit 1
+ endif
++ifdef CONFIG_RETPOLINE
++ifeq ($(RETPOLINE_CFLAGS),)
++ @echo "You are building kernel with non-retpoline compiler." >&2
++ @echo "Please update your compiler." >&2
++ @false
++endif
++endif
+
+ archclean:
+ $(Q)rm -rf $(objtree)/arch/i386
diff --git a/series.conf b/series.conf
index 7fdc48b6a7..adcf4e51e7 100644
--- a/series.conf
+++ b/series.conf
@@ -38,6 +38,7 @@
patches.rpmify/Revert-kconfig-only-write-CONFIG_FOO-is-not-set-for-.patch
patches.rpmify/powerpc-boot-Fix-missing-crc32poly.h-when-building-w.patch
patches.rpmify/scripts-mkmakefile-honor-second-argument.patch
+ patches.rpmify/x86-build-Fix-compiler-support-check-for-CONFIG_RETP.patch
########################################################
# kABI consistency patches