[Top] [All Lists]

Re: SRPMs for r3k cross development on i386

Subject: Re: SRPMs for r3k cross development on i386
From: "Gleb O. Raiko" <>
Date: Mon, 24 May 1999 11:47:11 +0400
Organization: NIISI RAN
References: <Pine.LNX.3.95.990518161349.13144A-100000@whale> <> <>

Karsten Merker wrote:
> Gleb O. Raiko wrote:
> > Unfortunately, SRPMs on bolug lack some features: binutils doesn't
> > contain r3k patch (there is no way to get working kernel for r3k without
> > the patch),
> I cannot follow you in this point: I am of course using the packages from
> myself and I have compiled all the kernels for my
> DECstation 5000/20 with it. The 5000/20 is a 20MHz R3000 (little endian).
> Is there a difference between big and little endian machines with respect
> to this?

No, both big- and little-endian boxes are affected. Look at
It contains macros (inliners, really) that are used to play with TLB,
tlb_*. All of them don't put nop after the instruction which changes
TLB. The problem is you can't predict what is the next instruction in
the command flow just after such macro. (If the next instruction
accesses a CP0 register, a nop must be inserted in the flow.) And there
is at least one place where it's necessary, i.e. there is a place where
we access a CP0 register just after the macro. Old kernels containted a
nop at the end of  the macros, then there was a company to remove all
nops and as a solution I patched the assembler in the way it can
understand that a nop is required and insert it.

Unfortunately, to make the check, you have to disassemble the kernel
image and look at all palces where tlb* instructions are used. I did
make the procedure only one and don't  repeat it for every kernel
version. My opinion is just to use the patch and not to care of the
subtle changes in the sources every time I download new kernel. Seems
reasonable to me. :-)

> > egcs isn't compiled on RH6.0 due to stupid new 'features' in
> > latest makeinfo. Thus, I had to repackage both and if somebody
> > interested I may send spec files, but for big-endian mips.
> Yes, I am interested. What in detail is the problem with the new makeinfo
> (I do not yet have RH6.0 installed)?

makeinfo in RH6.0 doesn't understand the sources of infos and fails to
produce the info files (which lead to compilation fail of entire egcs
package). The solution I stealed from RH compat-egcs is to compile egcs'
makeinfo and use it.

--- binutils-2.8.1.orig/opcodes/mips-opc.c      Mon May 26 21:34:19 1997
+++ binutils-2.8.1/opcodes/mips-opc.c   Wed Oct  7 14:16:21 1998
@@ -655,10 +655,10 @@
 {"tgeu",    "s,t",     0x00000031, 0xfc00003f, RD_s|RD_t|I2|TRAP },
 {"tgeu",    "s,j",     0x04090000, 0xfc1f0000, RD_s|I2|TRAP    }, /* tgeiu */
 {"tgeu",    "s,I",     2,    (int) M_TGEU_I,   INSN_MACRO      },
-{"tlbp",    "",                0x42000008, 0xffffffff, INSN_TLB        },
-{"tlbr",    "",                0x42000001, 0xffffffff, INSN_TLB        },
-{"tlbwi",   "",                0x42000002, 0xffffffff, INSN_TLB        },
-{"tlbwr",   "",                0x42000006, 0xffffffff, INSN_TLB        },
+{"tlbp",    "",                0x42000008, 0xffffffff, INSN_TLB|INSN_COP|COD   
+{"tlbr",    "",                0x42000001, 0xffffffff, INSN_TLB|INSN_COP|COD   
+{"tlbwi",   "",                0x42000002, 0xffffffff, INSN_TLB|INSN_COP|COD   
+{"tlbwr",   "",                0x42000006, 0xffffffff, INSN_TLB|INSN_COP|COD   
 {"tlti",    "s,j",     0x040a0000, 0xfc1f0000, RD_s|I2|TRAP    },
 {"tlt",     "s,t",     0x00000032, 0xfc00003f, RD_s|RD_t|I2|TRAP },
 {"tlt",     "s,j",     0x040a0000, 0xfc1f0000, RD_s|I2|TRAP    }, /* tlti */
Summary: Cross-binutils for mips-linux on i386 systems.
Name: mips-cross-binutils
Version: 2.8.1
Release: 1
Copyright: GPL
Group: Development/Tools
Source0: binutils-2.8.1.tar.gz 
Patch0: binutils-2.8.1-mips.patch
Patch1: binutils-2.8.1-gccbug.patch
Patch2: binutils-2.8.1-mips-a.out.patch
Patch3: binutils-2.8.1-mips-r3k.patch
Distribution: RedHat >=5.0
Buildroot: /var/tmp/binutils-root
Vendor: none
Packager: K. Merker <>

This package contains cross-binutils which allow the creation of binaries
to be run on big-endian Linux-MIPS (architecture "mips-linux") on
%setup -n binutils-2.8.1
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
./configure --target=mips-linux --prefix=/usr

mkdir -p $RPM_BUILD_ROOT/usr
make prefix=$RPM_BUILD_ROOT/usr install
rm -f $RPM_BUILD_ROOT/usr/bin/mips-linux-c++filt
rm -f $RPM_BUILD_ROOT/usr/lib/libiberty.a


Summary: Cross-egcs for mips-linux on i386 systems.
Name: mips-cross-egcs
Version: 1.0.2
Release: 1
Copyright: GPL
Group: Development/Languages
Source0: egcs-1.0.2.tar.gz
Patch0: egcs-1.0.2-libio.patch
Patch1: egcs-1.0.2-hjl.patch
Patch2: egcs-1.0.2-rth1.patch
Patch3: egcs-1.0.2-rth2.patch
Patch4: egcs-1.0.2-rth3.patch
Patch5: egcs-1.0.2-rth4.patch
Patch6: egcs-1.0.2-hjl2.patch
Patch7: egcs-1.0.2-jim.patch
Patch8: egcs-1.0.2-haifa.patch
Patch9: egcs-1.0.1-objcbackend.patch
Patch10: egcs-1.0.2-mips.patch
Buildroot: /var/tmp/egcs-root
Distribution: RedHat >=5.0
Vendor: none
Packager: K. Merker <>
Requires: mips-cross-binutils >= 2.8.1

This package contains a cross-egcs which allows the creation of
binaries to be run on big-endian Linux-MIPS (architecture
"mips-linux") on i386-machines.
Currently this is only a first-stage compiler, i.e. it can compile
a Linux kernel, but not user space applications.
%setup -n egcs-1.0.2
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1

CFLAGS=-O2 ./configure --prefix=/usr --with-newlib --target=mips-linux
cd texinfo
make all
cd ../gcc
make LANGUAGES="c" MAKEINFO=$RPM_BUILD_DIR/egcs-1.0.2/texinfo/makeinfo/makeinfo 

mkdir -p $RPM_BUILD_ROOT/usr
cd gcc
make LANGUAGES="c" MAKEINFO=$RPM_BUILD_DIR/egcs-1.0.2/texinfo/makeinfo/makeinfo 
install prefix=$RPM_BUILD_ROOT/usr


<Prev in Thread] Current Thread [Next in Thread>