Subject: Recommended toolchain

From: Simon Gee <[email-masked]>
Date: Tue, 20 Mar 2001 13:06:48 +1000

Hello,

Recently I've been working with various version mixes of the gnu tool
chain for a mipsel-linux target and settled on a patchy binutils
2.8.1/egcs 1.1.2/glibc 2.0.6 setup. However this lacks the functionality
that I would get from a newer toolchain for use with the linux 2.4
kernel. As a result, I was wondering if someone could recommend the
latest "stable"/recommended toolchain for a mipsel-linux target.

Thanks in advance,

Simon

---

From: Karel van Houten <[email-masked]>
Date: Tue, 20 Mar 2001 21:12:02 +0100 (MET)

Hi Simon,

> latest "stable"/recommended toolchain for a mipsel-linux target.

Well, I'm currently using:
binutils 2.10.1
gcc 2.95.3 (with Maciej's patches)
glibc 2.2.2 (compiled with above toolchain).

This toolchain works for native compiles on my mipsel box.
One drawback: I can't compile any kernels with this setup,
For kernel compiles I use 2.8.1/egcs-2.90.27/glibc-2.0.6.

-- 
Karel van Houten
----------------------------------------------------------
The box said "Requires Windows 95 or better."
I can't understand why it won't work on my Linux computer. 
----------------------------------------------------------

---

From: Ralf Baechle <[email-masked]>
Date: Tue, 20 Mar 2001 21:37:15 +0100

> For kernel compiles I use 2.8.1/egcs-2.90.27/glibc-2.0.6.

You MUST use minimum egcs-2.91.66 (1.1.2); older compilers WILL misscompile
kernels.

  Ralf

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Tue, 27 Mar 2001 21:02:33 +0200 (MET DST)

> For kernel compiles I use 2.8.1/egcs-2.90.27/glibc-2.0.6.

 What's wrong with the toolchain wrt the kernel now?  I've been compiling
2.4 kernels successfully till the end of January -- it's just a lack of
time and a nasty bug I want to track down that stop me from trying to
compile a new kernel these days.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email-masked], PGP key available        +

---

From: "Houten K.H.C. van (Karel)" <[email-masked]>
Date: Thu, 29 Mar 2001 19:28:37 +0200

Hi all,

>compile a new kernel these days.

This happens when I compile kernel 2.4.0-test9 with
binutils 2.10.1, gcc 2.95.3, glibc 2.2.2 on my 5000/260 (R4k)
(the same source/config compiles fine with 2.8.1/egcs-2.90.27/glibc-2.0.6):

# make boot
....
ld -static -G 0 -T arch/mips/ld.script.little -Ttext 0x80040000 arch/mips/kernel
/head.o arch/mips/kernel/init_task.o init/main.o init/version.o \
        --start-group \
        arch/mips/kernel/kernel.o arch/mips/mm/mm.o kernel/kernel.o mm/mm.o fs/f
s.o ipc/ipc.o arch/mips/dec/dec.o \
        drivers/block/block.o drivers/char/char.o drivers/misc/misc.o drivers/ne
t/net.o drivers/media/media.o drivers/parport/parport.a  drivers/scsi/scsidrv.o 
drivers/cdrom/cdrom.a drivers/tc/tc.a \
        net/network.o \
        arch/mips/lib/lib.a /usr/src/linux/lib/lib.a arch/mips/dec/prom/rexlib.a
 \
        --end-group \
        -o vmlinux
nm vmlinux | grep -v '\(compiled\)\|\(\.o$\)\|\( [aU] \)\|\(\.\.ng$\)\|\(LASH[RL
]DI\)' | sort > System.map
make[1]: Entering directory `/usr/src/linux-2.4.0t9-R4k/arch/mips/boot'
./elf2ecoff /usr/src/linux/vmlinux vmlinux.ecoff -a
wrote 20 byte file header.
wrote 56 byte a.out header.
wrote 240 bytes of section headers.
wrote 4 byte pad.
writing 30560 bytes...
Intersegment gap (-2147256160 bytes) too large.
make[1]: *** [vmlinux.ecoff] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.0t9-R4k/arch/mips/boot'
make: *** [boot] Error 2

---

From: Karel van Houten <[email-masked]>
Date: Thu, 29 Mar 2001 19:39:01 +0200 (MET DST)

Oh, and the resulting (ELF) kernel doesn't boot at all:
>>boot 3/rz0 1/new
delo V0.7 Copyright 2000 Florian Lohoff <[email-masked]>
Loading /etc/delo.conf .. ok
Loading /boot/vmlinux.new ....... ok

KN05 V2.1k    (PC: 0xa002cab8, SP: 0x8043fef0)

-- 
Karel van Houten

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Thu, 29 Mar 2001 19:51:29 +0200 (MET DST)

> (the same source/config compiles fine with 2.8.1/egcs-2.90.27/glibc-2.0.6):
[...]
> make[1]: Leaving directory `/usr/src/linux-2.4.0t9-R4k/arch/mips/boot'

 I recall I needed to edit the ld script for linux 2.4.0-test12 that I am
currently using.  Just watch out which sections have improper addresses. 
Alternatively grab a newer version -- the script was fixed later (by Ralf,
IIRC).

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Thu, 29 Mar 2001 20:10:15 +0200 (MET DST)

> KN05 V2.1k    (PC: 0xa002cab8, SP: 0x8043fef0)

 Well, this might be related to R4k you are using.  I have been able to
run kernels up to 2.4.0-test12 fine on my /240.  I tried the final 2.4.0
(or was it 2.4.1? -- I don't rememeber) on my machine and it booted but it
was very unstable -- I got a shell prompt but any moderate fs activity
killed it immediately.

 As it was the time I was building binutils 2.10.91 package I checked if
the version of binutils matters.  It didn't.  The 2.4.0-test12 version was
stable and the other one was not regardless of the binutils version used. 

 So I guess there may be something wrong with the R4k code generation in
gcc 2.95.2(3) (or possibly binutils, but the latter is quite unlikely).  I
can't run-time test R4k code but I may see if I can review the generated
binary of startup code up to the first line output for any
inconsistencies.  Don't hold your breath, though...