MIPS: SB1: Check optional compilation flags one by one
authorMaciej W. Rozycki <macro@linux-mips.org>
Sat, 28 Jun 2014 23:59:35 +0000 (00:59 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 30 Jul 2014 13:53:49 +0000 (15:53 +0200)
This fixes a regression caused by commit
bb6c0bd3fdb67c8a1fceea1d4700b9ee593309f9 [MIPS: SB1: Fix excessive kernel
warnings.], that makes `-march=r5000' selected for compilation flags
rather than supposed `-march=sb1' with compilers that do not support the
ASE selection flags introduced with that change.

For example GCC 4.1.2 supports `-mips3d'/`-mno-mips3d' (and obviously
`-march=sb1'), however it does not support `-mdmx'/`-mno-mdmx'.  As a
result the whole selection of flags fails and compilation resorts to using
`-march=r5000', meant for really old compilers indeed only.

It is always best to pick the flags individually unless we are absolutely
sure a set of flags was introduced to the toolchain together (`-march=sb1'
and `-mtune=sb1' would be a good example), and this change makes it happen
for CONFIG_CPU_SB1.  Consequently the flags ultimately selected with GCC
4.1.2 are `-march=sb1 -Wa,--trap -mno-mips3d'

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Richard Sandiford <rdsandiford@googlemail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7223/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Makefile

index a8521de14791840efae9e5496b774815b93b40ca..9336509f47ad61b129598d3f1ed6ee4a99aabefa 100644 (file)
@@ -151,8 +151,10 @@ cflags-$(CONFIG_CPU_NEVADA)        += $(call cc-option,-march=rm5200,-march=r5000) \
                        -Wa,--trap
 cflags-$(CONFIG_CPU_RM7000)    += $(call cc-option,-march=rm7000,-march=r5000) \
                        -Wa,--trap
-cflags-$(CONFIG_CPU_SB1)       += $(call cc-option,-march=sb1 -mno-mdmx -mno-mips3d,-march=r5000) \
+cflags-$(CONFIG_CPU_SB1)       += $(call cc-option,-march=sb1,-march=r5000) \
                        -Wa,--trap
+cflags-$(CONFIG_CPU_SB1)       += $(call cc-option,-mno-mdmx)
+cflags-$(CONFIG_CPU_SB1)       += $(call cc-option,-mno-mips3d)
 cflags-$(CONFIG_CPU_R8000)     += -march=r8000 -Wa,--trap
 cflags-$(CONFIG_CPU_R10000)    += $(call cc-option,-march=r10000,-march=r8000) \
                        -Wa,--trap