* [PATCH] MIPS: microMIPS: Work around an assembler bug.
@ 2014-04-07 17:40 Steven J. Hill
2014-04-09 19:43 ` Steven J. Hill
0 siblings, 1 reply; 4+ messages in thread
From: Steven J. Hill @ 2014-04-07 17:40 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
From: "Steven J. Hill" <Steven.Hill@imgtec.com>
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@imgtec.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] MIPS: microMIPS: Work around an assembler bug.
@ 2014-04-09 19:43 ` Steven J. Hill
0 siblings, 0 replies; 4+ messages in thread
From: Steven J. Hill @ 2014-04-09 19:43 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
On 04/07/2014 12:40 PM, Steven J. Hill wrote:
> From: "Steven J. Hill" <Steven.Hill@imgtec.com>
>
> 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@imgtec.com>
>
I rejected this in patchwork. Just making sure you do not use it.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] MIPS: microMIPS: Work around an assembler bug.
@ 2014-04-09 19:43 ` Steven J. Hill
0 siblings, 0 replies; 4+ messages in thread
From: Steven J. Hill @ 2014-04-09 19:43 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
On 04/07/2014 12:40 PM, Steven J. Hill wrote:
> From: "Steven J. Hill" <Steven.Hill@imgtec.com>
>
> 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@imgtec.com>
>
I rejected this in patchwork. Just making sure you do not use it.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] MIPS: microMIPS: Work around an assembler bug.
2014-04-09 19:43 ` Steven J. Hill
(?)
@ 2014-05-05 3:04 ` Maciej W. Rozycki
-1 siblings, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2014-05-05 3:04 UTC (permalink / raw)
To: Steven J. Hill; +Cc: linux-mips, Ralf Baechle
On Wed, 9 Apr 2014, Steven J. Hill wrote:
> > 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@imgtec.com>
> >
> I rejected this in patchwork. Just making sure you do not use it.
In any case I think using -mno-jals rather than -fno-delayed-branch would
be a better workaround, wouldn't it?
Maciej
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-05-05 3:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 17:40 [PATCH] MIPS: microMIPS: Work around an assembler bug Steven J. Hill
2014-04-09 19:43 ` Steven J. Hill
2014-04-09 19:43 ` Steven J. Hill
2014-05-05 3:04 ` Maciej W. Rozycki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.