LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* build failure of mips decstation_r4k_defconfig with binutils-2_37
@ 2021-08-17 11:54 Sudip Mukherjee
2021-08-17 12:55 ` Ralf Baechle
2021-08-17 13:36 ` Maciej W. Rozycki
0 siblings, 2 replies; 5+ messages in thread
From: Sudip Mukherjee @ 2021-08-17 11:54 UTC (permalink / raw)
To: Maciej W. Rozycki, Ralf Baechle, Paul Burton, James Hogan
Cc: linux-mips, linux-kernel, stable
Hi All,
While I was testing v5.4.142-rc2 I noticed mips build of
decstation_r4k_defconfig fails with binutils-2_37. The error is:
arch/mips/dec/prom/locore.S: Assembler messages:
arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this
processor: r4600 (mips3) `rfe'
I have also reported this at https://sourceware.org/bugzilla/show_bug.cgi?id=28241
--
Regards
Sudip
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: build failure of mips decstation_r4k_defconfig with binutils-2_37
2021-08-17 11:54 build failure of mips decstation_r4k_defconfig with binutils-2_37 Sudip Mukherjee
@ 2021-08-17 12:55 ` Ralf Baechle
2021-08-17 13:33 ` Sudip Mukherjee
2021-08-17 13:47 ` Maciej W. Rozycki
2021-08-17 13:36 ` Maciej W. Rozycki
1 sibling, 2 replies; 5+ messages in thread
From: Ralf Baechle @ 2021-08-17 12:55 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Maciej W. Rozycki, Paul Burton, James Hogan, linux-mips,
linux-kernel, stable
On Tue, Aug 17, 2021 at 12:54:32PM +0100, Sudip Mukherjee wrote:
> While I was testing v5.4.142-rc2 I noticed mips build of
> decstation_r4k_defconfig fails with binutils-2_37. The error is:
>
> arch/mips/dec/prom/locore.S: Assembler messages:
> arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this
> processor: r4600 (mips3) `rfe'
>
> I have also reported this at https://sourceware.org/bugzilla/show_bug.cgi?id=28241
It would appear gas got more anal about ISA checking for the RFE instructions
which did only exist in MIPS I and II; MIPS III and later use ERET for
returning from an exception.
The older gas I've got installed here happily accepts RFE in MIPS III/R4000
mode:
$ cat s.s
rfe
eret
$ mips-linux-as -o s.o s.s
s.s: Assembler messages:
s.s:2: Error: opcode not supported on this processor: mips1 (mips1) `eret'
$ mips-linux-as -march=r4000 -o s.o s.s
$ mips-linux-objdump -d s.o
s.o: file format elf32-tradbigmips
Disassembly of section .text:
00000000 <.text>:
0: 42000010 c0 0x10 # <- RFE
4: 42000018 eret
...
$
It's easy to find arguments for why this gas change is the right thing to
do - and not the right thing to do.
It should be fixable by simply putting gas into mips1 mode. Can you test
below patch?
Ralf
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
diff --git a/arch/mips/dec/prom/locore.S b/arch/mips/dec/prom/locore.S
index 0eb8fab62ab0..8d00ca8872f9 100644
--- a/arch/mips/dec/prom/locore.S
+++ b/arch/mips/dec/prom/locore.S
@@ -16,6 +16,7 @@
NESTED(genexcept_early, 0, sp)
.set noat
.set noreorder
+ .set mips1
mfc0 k0, CP0_STATUS
la k1, mem_err
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: build failure of mips decstation_r4k_defconfig with binutils-2_37
2021-08-17 12:55 ` Ralf Baechle
@ 2021-08-17 13:33 ` Sudip Mukherjee
2021-08-17 13:47 ` Maciej W. Rozycki
1 sibling, 0 replies; 5+ messages in thread
From: Sudip Mukherjee @ 2021-08-17 13:33 UTC (permalink / raw)
To: Ralf Baechle
Cc: Maciej W. Rozycki, Paul Burton, James Hogan, linux-mips,
linux-kernel, Stable
Hi Ralf,
On Tue, Aug 17, 2021 at 1:55 PM Ralf Baechle <ralf@linux-mips.org> wrote:
>
> On Tue, Aug 17, 2021 at 12:54:32PM +0100, Sudip Mukherjee wrote:
>
> > While I was testing v5.4.142-rc2 I noticed mips build of
> > decstation_r4k_defconfig fails with binutils-2_37. The error is:
> >
> > arch/mips/dec/prom/locore.S: Assembler messages:
> > arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this
> > processor: r4600 (mips3) `rfe'
> >
> > I have also reported this at https://sourceware.org/bugzilla/show_bug.cgi?id=28241
>
> It would appear gas got more anal about ISA checking for the RFE instructions
> which did only exist in MIPS I and II; MIPS III and later use ERET for
> returning from an exception.
>
> The older gas I've got installed here happily accepts RFE in MIPS III/R4000
> mode:
>
<snip>
>
> It's easy to find arguments for why this gas change is the right thing to
> do - and not the right thing to do.
>
> It should be fixable by simply putting gas into mips1 mode. Can you test
> below patch?
Tested on top of v5.4.142-rc2 and it builds again. Thanks for the
quick reply and the patch.
--
Regards
Sudip
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: build failure of mips decstation_r4k_defconfig with binutils-2_37
2021-08-17 11:54 build failure of mips decstation_r4k_defconfig with binutils-2_37 Sudip Mukherjee
2021-08-17 12:55 ` Ralf Baechle
@ 2021-08-17 13:36 ` Maciej W. Rozycki
1 sibling, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2021-08-17 13:36 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Jan-Benedict Glaw, Ralf Baechle, Paul Burton, James Hogan,
linux-mips, linux-kernel, stable
On Tue, 17 Aug 2021, Sudip Mukherjee wrote:
> While I was testing v5.4.142-rc2 I noticed mips build of
> decstation_r4k_defconfig fails with binutils-2_37. The error is:
>
> arch/mips/dec/prom/locore.S: Assembler messages:
> arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this
> processor: r4600 (mips3) `rfe'
>
> I have also reported this at https://sourceware.org/bugzilla/show_bug.cgi?id=28241
Thanks. I have known it for a while thanks to an earlier report from
Jan-Benedict Glaw, but didn't get to fixing it. I mean to address it
sometime later this month or early Sep the latest.
This file shouldn't be built for R4k configurations in the first place
because they use the REX firmware exclusively, which this source has
nothing to do with. A trivial fix would be to override the ISA level
temporarily across RFE, but that's missing the point as it's dead code
anyway with R4k. OTOH a proper fix requires proper verification.
As a workaround use older binutils for the time being. Apologies for the
inconvenience.
Maciej
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: build failure of mips decstation_r4k_defconfig with binutils-2_37
2021-08-17 12:55 ` Ralf Baechle
2021-08-17 13:33 ` Sudip Mukherjee
@ 2021-08-17 13:47 ` Maciej W. Rozycki
1 sibling, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2021-08-17 13:47 UTC (permalink / raw)
To: Ralf Baechle
Cc: Sudip Mukherjee, Paul Burton, James Hogan, linux-mips,
linux-kernel, stable
On Tue, 17 Aug 2021, Ralf Baechle wrote:
> > While I was testing v5.4.142-rc2 I noticed mips build of
> > decstation_r4k_defconfig fails with binutils-2_37. The error is:
> >
> > arch/mips/dec/prom/locore.S: Assembler messages:
> > arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this
> > processor: r4600 (mips3) `rfe'
> >
> > I have also reported this at https://sourceware.org/bugzilla/show_bug.cgi?id=28241
>
> It would appear gas got more anal about ISA checking for the RFE instructions
> which did only exist in MIPS I and II; MIPS III and later use ERET for
> returning from an exception.
Yes, I made such a change when I discovered the mess around coprocessor
instructions in binutils earlier this year. Eighteen patches total to
straighten it out. Some instructions were misassembled even, and no
proper subsetting was made, so you could come with a nonsensical mixture
when disassembling. And RFE was disassembled as `c0 0x10' regardless of
the ISA chosen.
> It should be fixable by simply putting gas into mips1 mode. Can you test
> below patch?
But it's missing the point, as I noted in the other message. I've been
too busy with higher priority stuff to get to a proper fix right away (I
thought I was the last one using the DECstation, and especially with the
top of the tree binutils).
Maciej
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-17 13:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 11:54 build failure of mips decstation_r4k_defconfig with binutils-2_37 Sudip Mukherjee
2021-08-17 12:55 ` Ralf Baechle
2021-08-17 13:33 ` Sudip Mukherjee
2021-08-17 13:47 ` Maciej W. Rozycki
2021-08-17 13:36 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).