Skip to content

Commit 2f2b4fd

Browse files
committed
MIPS: Disable Loongson MMI instructions for kernel build
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 <[email protected]> Fixes: 3702bba ("MIPS: Loongson: Add GCC 4.4 support for Loongson2E") Fixes: 6f7a251 ("MIPS: Loongson: Add basic Loongson 2F support") Fixes: 5188129 ("MIPS: Loongson-3: Improve -march option and move it to Platform") Cc: Huacai Chen <[email protected]> Cc: Jiaxun Yang <[email protected]> Cc: [email protected] # v2.6.32+ Cc: [email protected]
1 parent 38dffe1 commit 2f2b4fd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

arch/mips/loongson64/Platform

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ else
6666
$(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
6767
endif
6868

69+
# Some -march= flags enable MMI instructions, and GCC complains about that
70+
# support being enabled alongside -msoft-float. Thus explicitly disable MMI.
71+
cflags-y += $(call cc-option,-mno-loongson-mmi)
72+
6973
#
7074
# Loongson Machines' Support
7175
#

arch/mips/vdso/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ccflags-vdso := \
1515
$(filter -mmicromips,$(KBUILD_CFLAGS)) \
1616
$(filter -march=%,$(KBUILD_CFLAGS)) \
1717
$(filter -m%-float,$(KBUILD_CFLAGS)) \
18+
$(filter -mno-loongson-%,$(KBUILD_CFLAGS)) \
1819
-D__VDSO__
1920

2021
ifdef CONFIG_CC_IS_CLANG

0 commit comments

Comments
 (0)