When we configure the toolchain, we can set the default ISA level to be used when none is set in the command line. This, however, has some undesired consequences when the parameters used in the command line are incompatible with the built-in ISA level of the toolchain. In order to minimize such problems, we set a good default ISA level if the Makefile hasn't set one for the selected processor. Cc: Matthew Fortune <Matthew.Fortune@xxxxxxxxxx> Signed-off-by: Markos Chandras <markos.chandras@xxxxxxxxxx> --- arch/mips/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 0608ec524d3d..a244fb311a37 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -226,6 +226,15 @@ cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic drivers-$(CONFIG_PCI) += arch/mips/pci/ # +# Don't trust the toolchain defaults. Use a sensible -march +# option but only if we don't have one already. +# +ifeq (,$(findstring march=, $(cflags-y))) +cflags-$(CONFIG_32BIT) += -march=mips32 +cflags-$(CONFIG_64BIT) += -march=mips64 +endif + +# # Automatically detect the build format. By default we choose # the elf format according to the load address. # We can always force a build with a 64-bits symbol format by -- 2.2.2