Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert MIPS: Loongson: Fix build error when make modules_install

Revert commit 531b3d1195d0 ("MIPS: Loongson: Fix build error when make
modules_install"), which made `-march=loongson2e', `-march=loongson2f',
and `-march=loongson3a' compilation options probed for even though GCC
has supported them since 4.4.0, 4.4.0, and 4.6.0 respectively, which is
below our current minimum requirement of 5.1, in an attempt to work
around for the `cc-option' `make' function being undefined with `make'
targets that do not use the compiler. The workaround has now been made
obsolete, by querying the `need-compiler' variable instead so as to make
sure the compiler isn't called for non-build targets.

Verified with `fuloong2e_defconfig' and the `modules_install' target.

Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Maciej W. Rozycki and committed by
Thomas Bogendoerfer
0859bdf1 4fe4a637

+7 -3
+7 -3
arch/mips/Makefile
··· 181 181 cflags-$(CONFIG_CAVIUM_CN63XXP1) += -Wa,-mfix-cn63xxp1 182 182 cflags-$(CONFIG_CPU_BMIPS) += -march=mips32 -Wa,-mips32 -Wa,--trap 183 183 184 - cflags-$(CONFIG_CPU_LOONGSON2E) += $(call cc-option,-march=loongson2e) -Wa,--trap 185 - cflags-$(CONFIG_CPU_LOONGSON2F) += $(call cc-option,-march=loongson2f) -Wa,--trap 186 - cflags-$(CONFIG_CPU_LOONGSON64) += $(call cc-option,-march=loongson3a,-march=mips64r2) -Wa,--trap 184 + cflags-$(CONFIG_CPU_LOONGSON2E) += -march=loongson2e -Wa,--trap 185 + cflags-$(CONFIG_CPU_LOONGSON2F) += -march=loongson2f -Wa,--trap 187 186 # Some -march= flags enable MMI instructions, and GCC complains about that 188 187 # support being enabled alongside -msoft-float. Thus explicitly disable MMI. 189 188 cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-mno-loongson-mmi) 189 + ifdef CONFIG_CPU_LOONGSON64 190 + cflags-$(CONFIG_CPU_LOONGSON64) += -Wa,--trap 191 + cflags-$(CONFIG_CC_IS_GCC) += -march=loongson3a 192 + cflags-$(CONFIG_CC_IS_CLANG) += -march=mips64r2 193 + endif 190 194 cflags-$(CONFIG_CPU_LOONGSON64) += $(call cc-option,-mno-loongson-mmi) 191 195 192 196 cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,)