MIPS: Loongson64: test for -march=loongson3a cflag
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Fri, 2 Feb 2024 18:21:44 +0000 (18:21 +0000)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 23 Feb 2024 09:13:47 +0000 (10:13 +0100)
Currently march flag is hardcoded to loongson3a for GCC and
mips64r2 for clang.

We can actually test it to simplify the code.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/Makefile

index 5a078c5487d6acdbf1a3c8fa7ae712d606f0753b..80aecba2489223e31cfd78fd85c9bc924ed82a13 100644 (file)
@@ -187,11 +187,8 @@ cflags-$(CONFIG_CPU_LOONGSON2F) += \
 # Some -march= flags enable MMI instructions, and GCC complains about that
 # support being enabled alongside -msoft-float. Thus explicitly disable MMI.
 cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-mno-loongson-mmi)
-ifdef CONFIG_CPU_LOONGSON64
-cflags-$(CONFIG_CPU_LOONGSON64)        += -Wa,--trap
-cflags-$(CONFIG_CC_IS_GCC) += -march=loongson3a
-cflags-$(CONFIG_CC_IS_CLANG) += -march=mips64r2
-endif
+cflags-$(CONFIG_CPU_LOONGSON64)        += \
+                       $(call cc-option,-march=loongson3a,-march=mips64r2) -Wa,--trap
 cflags-$(CONFIG_CPU_LOONGSON64) += $(call cc-option,-mno-loongson-mmi)
 
 cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,)