]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Oct 2019 13:29:01 +0000 (06:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Oct 2019 13:29:01 +0000 (06:29 -0700)
added patches:
mips-disable-loongson-mmi-instructions-for-kernel-build.patch

queue-4.9/mips-disable-loongson-mmi-instructions-for-kernel-build.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/mips-disable-loongson-mmi-instructions-for-kernel-build.patch b/queue-4.9/mips-disable-loongson-mmi-instructions-for-kernel-build.patch
new file mode 100644 (file)
index 0000000..c2d9c20
--- /dev/null
@@ -0,0 +1,60 @@
+From 2f2b4fd674cadd8c6b40eb629e140a14db4068fd Mon Sep 17 00:00:00 2001
+From: Paul Burton <paul.burton@mips.com>
+Date: Thu, 10 Oct 2019 18:54:03 +0000
+Subject: MIPS: Disable Loongson MMI instructions for kernel build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Paul Burton <paul.burton@mips.com>
+
+commit 2f2b4fd674cadd8c6b40eb629e140a14db4068fd upstream.
+
+GCC 9.x automatically enables support for Loongson MMI instructions when
+using some -march= flags, and then errors out when -msoft-float is
+specified with:
+
+  cc1: error: ‘-mloongson-mmi’ must be used with ‘-mhard-float’
+
+The kernel shouldn't be using these MMI instructions anyway, just as it
+doesn't use floating point instructions. Explicitly disable them in
+order to fix the build with GCC 9.x.
+
+Signed-off-by: Paul Burton <paul.burton@mips.com>
+Fixes: 3702bba5eb4f ("MIPS: Loongson: Add GCC 4.4 support for Loongson2E")
+Fixes: 6f7a251a259e ("MIPS: Loongson: Add basic Loongson 2F support")
+Fixes: 5188129b8c9f ("MIPS: Loongson-3: Improve -march option and move it to Platform")
+Cc: Huacai Chen <chenhc@lemote.com>
+Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
+Cc: stable@vger.kernel.org # v2.6.32+
+Cc: linux-mips@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/loongson64/Platform |    4 ++++
+ arch/mips/vdso/Makefile       |    1 +
+ 2 files changed, 5 insertions(+)
+
+--- a/arch/mips/loongson64/Platform
++++ b/arch/mips/loongson64/Platform
+@@ -43,6 +43,10 @@ else
+       $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
+ endif
++# Some -march= flags enable MMI instructions, and GCC complains about that
++# support being enabled alongside -msoft-float. Thus explicitly disable MMI.
++cflags-y += $(call cc-option,-mno-loongson-mmi)
++
+ #
+ # Loongson Machines' Support
+ #
+--- a/arch/mips/vdso/Makefile
++++ b/arch/mips/vdso/Makefile
+@@ -8,6 +8,7 @@ ccflags-vdso := \
+       $(filter -mmicromips,$(KBUILD_CFLAGS)) \
+       $(filter -march=%,$(KBUILD_CFLAGS)) \
+       $(filter -m%-float,$(KBUILD_CFLAGS)) \
++      $(filter -mno-loongson-%,$(KBUILD_CFLAGS)) \
+       -D__VDSO__
+ cflags-vdso := $(ccflags-vdso) \
+       $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
index 8caed54b1a2cb86a8d419c1c418e36b2e8553e64..ea02b795d7f8a805a470f6cf203a9d885b6acc25 100644 (file)
@@ -83,3 +83,4 @@ cifs-force-reval-dentry-if-lookup_reval-flag-is-set.patch
 kernel-sysctl.c-do-not-override-max_threads-provided-by-userspace.patch
 staging-fbtft-stop-using-bl_core_driver1.patch
 staging-fbtft-fix-memory-leak-in-fbtft_framebuffer_a.patch
+mips-disable-loongson-mmi-instructions-for-kernel-build.patch