Skip to contentSkip to conversation

Recommended toolchain

DISCUSSION Simon Gee 5 participants 10 messages Mar 20, 2001 – Apr 1, 2001 MIPS

lore
Share & tools
lore

Simon Gee

author
#0 lore raw

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

#1 lore raw

Hi Simon,

Quoted 6 lines · You

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.

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.

Signature · 5 lines
Karel van Houten
----------------------------------------------------------
The box said "Requires Windows 95 or better."
I can't understand why it won't work on my Linux computer. 
----------------------------------------------------------
#2 lore raw
Quoted 8 lines · Karel van Houten
Quoted 6 lines · You

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.

Quoted 8 lines

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.

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

Ralf

#3 lore raw
In reply to Karel van Houten
Quoted 8 lines · Karel van Houten

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.

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.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#4 lore raw

Hi all,

Quoted 4 lines · Maciej W. Rozycki

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.

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
#5 lore raw
Quoted 4 lines · I wrote:

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):
....

Oh, and the resulting (ELF) kernel doesn't boot at all:

Quoted 1 line
Quoted 1 line

boot 3/rz0 1/new

delo V0.7 Copyright 2000 Florian Lohoff <[email protected]> Loading /etc/delo.conf .. ok
Loading /boot/vmlinux.new ....... ok

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

Quoted 1 line
Quoted 1 line
Signature · 6 lines
Karel van Houten

----------------------------------------------------------
The box said "Requires Windows 95 or better."
I can't understand why it won't work on my Linux computer. 
----------------------------------------------------------
#6 lore raw
Quoted 8 lines · Karel van Houten

Oh, and the resulting (ELF) kernel doesn't boot at all:

Quoted 1 line
Quoted 1 line

boot 3/rz0 1/new

delo V0.7 Copyright 2000 Florian Lohoff <[email protected]> Loading /etc/delo.conf .. ok
Loading /boot/vmlinux.new ....... ok

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

Quoted 1 line
Quoted 1 line

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...

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#7 lore raw
Quoted 5 lines · Maciej W. Rozycki

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...

I've now done a native compile of a CVS checkout from Friday, and it does compile. It even boots, up until:

esp0: target 1 [period 248ns offset 15 4.03MHz synchronous SCSI]
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.12
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 2048 buckets, 16Kbytes
TCP: Hash tables configured (established 16384 bind 16384)
Unhandled kernel unaligned access in unaligned.c:emulate_load_store_insn, line 372:
$0 : 00000000 10010c00 8017fed0 00000000
$4 : 801fe33c 80200000 813de000 802db000
$8 : 10010c01 8019af20 00000000 00000000
$12: 00000000 fffff000 fffffff7 802db060
$16: 00000000 813de000 00000001 00000000
$20: 00000005 801cbe34 801eb070 801eb1ac
$24: 00000000 0000000a
$28: 8022e000 8022fe88 00000000 80066cc0
epc : 8017ff08
Status: 10010c03
Cause : 00002010
Process swapper (pid: 1, stackpage=8022e000)

etc.
I have not yet found the time to look further into that...

#8 lore raw
Quoted 17 lines · Houten K.H.C. van (Karel)

IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 2048 buckets, 16Kbytes
TCP: Hash tables configured (established 16384 bind 16384)
Unhandled kernel unaligned access in unaligned.c:emulate_load_store_insn, line 372:
$0 : 00000000 10010c00 8017fed0 00000000
$4 : 801fe33c 80200000 813de000 802db000
$8 : 10010c01 8019af20 00000000 00000000
$12: 00000000 fffff000 fffffff7 802db060
$16: 00000000 813de000 00000001 00000000
$20: 00000005 801cbe34 801eb070 801eb1ac
$24: 00000000 0000000a
$28: 8022e000 8022fe88 00000000 80066cc0
epc : 8017ff08
Status: 10010c03
Cause : 00002010
Process swapper (pid: 1, stackpage=8022e000)

Quoted 2 lines

etc.
I have not yet found the time to look further into that...

Guido did that last weekend and discovered that this is a toolchain problem which disappears when compiling with gcc 3.0

Flo

Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
     Why is it called "common sense" when nobody seems to have any?
#9 lore raw
In reply to Houten K.H.C. van (Karel)
Quoted 3 lines · Houten K.H.C. van (Karel)

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):

[...]

Quoted 10 lines

./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

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).

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +