Re: Trouble compiling 2.2.10 on a Mips/R4x00 (Indy)

Ralf Baechle (ralf@uni-koblenz.de)
Wed, 23 Jun 1999 11:56:25 +0200


On Tue, Jun 22, 1999 at 12:48:09PM +0200, Martin Andersen wrote:

> When cross-compiling 2.2.10 for use on an Indy, my compiler dies with
> various "internal errors" (see the snippet below).
>
> I am using the cross-compiler utilities (by Ralf Baechle) installed on an
> i386 system.
> [ 2569426 Jun 22 11:19 binutils-x-mips-2.8.1-1.i386.rpm
> 1499625 Jun 22 11:19 gcc-x-mips-2.7.2.2-1.i386.rpm ]

I myself defintely never published anything 2.7.2.x based. Anyway, I
urgently recommend switching over to egcs 1.0.x and while you're at it
binutils 2.8.1-2. Sorry, no binaries for these packages available, just
patches against the vanilla FSF version. Go and download

/pub/linux/mips/src/binutils/binutils-2.8.1-2.diff.gz
/pub/linux/mips/src/egcs/egcs-1.0.3a.diff.gz

The whole procedure of building a crosscompiler is described on
www.linux.sgi.com.

I'll upload newer rpms whenever I find the time to do so.

> $ make CROSS_COMPILE=mips-linux- zImage
> mips-linux-gcc -D__KERNEL__ -I/usr/src/linux-2.2.10/include -Wall
> -Wstrict-prototypes -O2 -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic
> -m
> cpu=r4600 -mips2 -pipe -c -o init/main.o init/main.c
> /usr/src/linux-2.2.10/include/asm/io.h: In function `copro_timeout':
> /usr/src/linux-2.2.10/include/asm/io.h:87: `asm' operand requires
> impossible reload
> /usr/src/linux-2.2.10/include/asm/io.h:87: `asm' operand requires
> impossible reload
> /usr/src/linux-2.2.10/include/asm/bugs.h: In function `check_fpu':
> In file included from init/main.c:27:
> /usr/src/linux-2.2.10/include/asm/bugs.h:135: internal error--insn does
> not satisfy its constraints:
> (insn 244 241 250 (set (reg:SI 66 accum)
> (reg:SI 6 a2)) 159 {movsi_internal2} (insn_list 241
> (insn_list:REG_DEP_ANTI 98 (insn_list:REG_DEP_OUTPUT 139
> (insn_list:REG_DEP_ANTI
> 247 (insn_list:REG_DEP_ANTI 151 (nil))))))
> (nil))
> mips-linux-gcc: Internal compiler error: program cc1 got fatal signal 6
> make: *** [init/main.o] Error 1
> [<-=¤¤ r00t ¤¤=->] @pangea cwd: /usr/src/linux ]$ cpp: output pipe has
> been closed
> {standard input}: Assembler messages:
> {standard input}:44: Error: unrecognized opcode `movl'
> {standard input}:49: Error: unrecognized opcode `movl'
> {standard input}:91: Error: unrecognized opcode `andl'
> {standard input}:103: Error: unrecognized opcode `outb'
> {standard input}:104: Error: unrecognized opcode `outb'
> {standard input}:109: Error: unrecognized opcode `outb'
> {standard input}:110: Error: unrecognized opcode `outb'

Pilot error. You tried to compile the i386 code with the MIPS compiler and
wonder why the pyrotechnics are flying. General answer: pass ARCH=mips to
the make calls or modify the ARCH variable in the main Makefile to the value
mips or any other architecture you're building for. MIPS specific answer:
the messages above show that you're trying to build vanilla 2.2.10 which
doesn't have all the MIPS code. Fix: get a snapshot of the sources from
ftp.linux.sgi.com in /pub/linux/mips/test/ or checkout the linux_2_2 branch
via anonymous CVS. Details are described in the FAQ on www.linux.sgi.com.

Or just download a kernel binary ...

Ralf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/