[PATCH] MIPS: microMIPS: Work around an assembler bug.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven J. Hill" <Steven.Hill@xxxxxxxxxx>

In newer toolchains, the 16-bit branch delay slot instruction
calculation is wrong. We get a message very similar to:

   {standard input}: Assembler messages:
   {standard input}:7035: Warning: wrong size instruction
   in a 16-bit branch delay slot

This corner case only occurs in 'arch/mips/kernel/traps.c' and
we add the '-fno-delayed-branch' option when compiling it.

Signed-off-by: Steven J. Hill <Steven.Hill@xxxxxxxxxx>
---
 arch/mips/kernel/Makefile |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 66c6705..76c8638 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -116,4 +116,12 @@ CFLAGS_branch.o			= $(CFLAGS_DSP)
 CFLAGS_ptrace.o			= $(CFLAGS_DSP)
 endif
 
+#
+# Workaround for newer toolchains when building microMIPS kernels.
+#
+ifeq ($(CONFIG_CPU_MICROMIPS), y)
+CFLAGS_traps.o    = $(shell if [ $(call cc-version) -gt 0407 ]; then \
+			echo $(call cc-option, -fno-delayed-branch); fi)
+endif
+
 CPPFLAGS_vmlinux.lds		:= $(KBUILD_CFLAGS)
-- 
1.7.10.4



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux