Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
#11
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
(04-14-2020, 12:07 PM)jan-jaap Wrote:  I think Raion meant MIPS4 and IRIX 6.5, not IRIX 4.

FWIW, I have GCC and binutils for IRIX 5.3 on my FTP ftp://ftp.jurassic.nl/pub/irix/gnu/irix-5.3/

I have various bits and pieces for IRIX 4 too: ftp://ftp.jurassic.nl/pub/irix/gnu/irix-4.0/
IRIX 4 is COFF based and shared libraries were a real pain. I'd stick with IRIX 5.x if your systems runs it well.
Hello Jan
Thank you for the share.I installed your binutils and gcc binaries for IRI 5.3 -  all of them do Bus error. Its hard to investigate the reason via stack backtrack info in core (stripped). It seems you used nekoware to build it. I have not installed nekoware. Almost all of necoware and tgcware binaries do core dump on my system, despite of I installed IRIX patches Tom G. Christensen recommended.
Also original inst and swmgr of IRIX 5.3 do not understand nekoware distribution files and I can not find an IRIX patch which upgrade 5.3 swmgr. I have to unpack nekoware dist files by utility http://persephone.cps.unizar.es/~spd/src/other/mydb.c which I modified little bit.

IRIX 4 binutils om my 5.3 do not core dump but unfortunately do not work correctly (at least ar).

So I continue to try building binutils/gcc )
dstep
O2

Trade Count: (0)
Posts: 22
Threads: 6
Joined: Dec 2019
Find Reply
04-16-2020, 01:21 PM
#12
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
Nekoware will not work on 5.3!

There's absolutely nothing from 6.2+ that will work on 5.3

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-16-2020, 04:17 PM
#13
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
(04-16-2020, 01:21 PM)dstep Wrote:  Hello Jan
Thank you for the share.I installed your binutils and gcc binaries for IRI 5.3 -  all of them do Bus error. Its hard to investigate the reason via stack backtrack info in core (stripped). It seems you used nekoware to build it. I have not installed nekoware. Almost all of necoware and tgcware binaries do core dump on my system, despite of I installed IRIX patches Tom G. Christensen recommended.
Also original inst and swmgr of IRIX 5.3 do not understand nekoware distribution files and I can not find an IRIX patch which upgrade 5.3 swmgr. I have to unpack nekoware dist files by utility http://persephone.cps.unizar.es/~spd/src/other/mydb.c which I modified little bit.

IRIX 4 binutils om my 5.3 do not core dump but unfortunately do not work correctly (at least ar).

So I continue to try building binutils/gcc )

As said, Nekoware requires IRIX 6.5. However if all TGCware and my binaries bus error, I suspect an error on your side rather than mine.

You intended to build this on an old PowerSeries system with R3000 CPUs right? That's going to takes ages (days or weeks even), and unless you have maxed out RAM (256MB on these systems) you will probably simply run out of memory.

My preferred build environment for this is a chrooted IRIX 5.3 install (system files taken from a 4D/440 VGX) running on my Origin 350 with 8*R16K CPUs and 16GB RAM. I'm basically using a 5.3 system loaded with the last patches, the last IDO and WorkShop that will run on IRIX 5.3 plus TGCware for essentials like gzip and bash. I fired up the O350 and found an even newer GCC:

Code:
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gnu/libexec/gcc/mips-sgi-irix5.3/4.5.1/lto-wrapper
Target: mips-sgi-irix5.3
Configured with: /build53/gcc/release/gcc-4.5.1-r1/gcc-4.5.1/configure -v --enable-languages=c,ada,c++,fortran,objc,obj-c++ --prefix=/usr/local/gnu --enable-shared --disable-nls --with-gnu-as --with-as=/usr/local/gnu/mips-sgi-irix5.3/bin/as --without-gnu-ld --with-ld=/usr/bin/ld --with-mpfr=/usr/local/gnu --enable-checking=release --enable-obsolete
Thread model: single
gcc version 4.5.1 (GCC)
(Yeah, it does Ada too).

On this system it all works fine. It creates ELF 32-bit mips1 binaries so it should work on an R3000 too. There's only one problem: when I download the gcc tarball from my FTP to another system of mine, an R4400 IMPACT Indigo2 running IRIX 5.3, it fails the link step because the (IRIX) ld complains about the object file format (but it doesn't bus error). Now, this is a long time ago, but IIRC at some point there was a patch to the IRIX 5.3 IDO which replaced the linker with what was essentially a backport of the much newer MIPSpro linker. This patch was restricted to people with a support contract. At the time you had the somewhat bizarre choice between depending your "free software" compiler on a restricted patch which resulted in the best regression test results OR using GNU ld and suffer. It's obvious I chose the former but now I have to figure out what that patch was :(  I sincerely doubt that anybody at whatever is left of SGI will care if I bundle that with the compiler.

Update: found it:

Code:
       1.2  Supported_Software_Platforms

       This patch contains an update for IDO (5.3) on a system
       running IRIX 5.3.  The software cannot be installed on other
       configurations.

       1.3  Bugs_Fixed_by_Patch_SG0001068

       This patch contains a new linker which is now available for
       IRIX 5.3.  This linker provides link times which are often
       much faster than the previous linker, particularly on large
       programs.  The IRIX 5.3 stock linker is still available via
       use of the "-old_ld" flag, and is the default linker for C++
       programs.

       This patch also contains specific fixes for previous
       patches.  In particular, this patch supersedes both Patch
       SG0000410 and Patch SG0000268.

       Specific bugs fixed by this patch include fixes for -abi
       operation (Ref #310776), and problems with strip (Ref
       #321236).

Find it on my FTP: patchSG0001068.tardist

Now it works on the Indigo2 as well:

Code:
mgras 1% uname -a
IRIX mgras 5.3 12201932 IP22 mips
mgras 2% /usr/local/gnu/bin/gcc -v
Using built-in specs.
Target: mips-sgi-irix5.3
Configured with: ../configure -v --enable-languages=c,ada,c++,fortran,objc,obj-c++ --prefix=/usr/local/gnu --enable-shared --enable-objc-gc --disable-nls --with-gnu-as --with-as=/usr/local/gnu/mips-sgi-irix5.3/bin/as --without-gnu-ld --with-ld=/usr/bin/ld --with-mpfr-include=/usr/local/gnu/include --with-mpfr-lib=/usr/local/gnu/lib --enable-checking=release
Thread model: single
gcc version 4.4.2 (GCC)
mgras 3% /usr/local/gnu/bin/gcc -o hello hello.c
mgras 4% file hello
hello:          ELF 32-bit MSB dynamic executable MIPS - version 1
mgras 5% ./hello
Hello, IRIX world!
mgras 6%

When using these compiler binaries you might want to add /usr/local/gnu/lib to your LD_LIBRARY_PATH and /usr/local/gnu/bin to your PATH. That's all.
(This post was last modified: 04-17-2020, 10:07 AM by jan-jaap.)
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
04-17-2020, 08:56 AM
#14
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
Thank you for information Jan

I had problem with some IRIX patches. swmgr complains about incompatible patches in unusual way. I will make new thread for this.

About time which the building takes - I already work on this bootstap several months. Install IRIX, install IDO, install patches, problem with patches - reinstall IRIX, IDO etc... Magic ring )
The same with gnu.
Now I'm thinking about crosscompiling. I found this:
https://forums.sgi.sh/index.php?threads/...tures.194/
(This post was last modified: 04-17-2020, 12:06 PM by dstep.)
dstep
O2

Trade Count: (0)
Posts: 22
Threads: 6
Joined: Dec 2019
Find Reply
04-17-2020, 11:53 AM
#15
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
(04-17-2020, 11:53 AM)dstep Wrote:  Thank you for information Jan

I had problem with some IRIX patches. swmgr complains about incompatible patches in unusual way. I will make new thread for this.

You have to be careful with IRIX 5.3 and patches because it's even worse. Some patches will apply but thrash your system. You have to be especially careful with the graphics patches. This (and bandwidth preservation) is why you have patch sets for different types of systems for the same version of IRIX.

I once made one directory with all IRIX 5.3 patches and left it up to inst to sort out what to install. It thrashed my 4D/35 beyond recovery. Had to re-install from scratch.
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
04-17-2020, 12:05 PM
#16
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
(04-17-2020, 12:05 PM)jan-jaap Wrote:  
(04-17-2020, 11:53 AM)dstep Wrote:  Thank you for information Jan

I had problem with some IRIX patches. swmgr complains about incompatible patches in unusual way. I will make new thread for this.

You have to be careful with IRIX 5.3 and patches because it's even worse. Some patches will apply but thrash your system. You have to be especially careful with the graphics patches. This (and bandwidth preservation) is why you have patch sets for different types of systems for the same version of IRIX.

I once made one directory with all IRIX 5.3 patches and left it up to inst to sort out what to install. It thrashed my 4D/35 beyond recovery. Had to re-install from scratch.
Yes I know
I had to reinstall IRIX already 3 or 4 times )
dstep
O2

Trade Count: (0)
Posts: 22
Threads: 6
Joined: Dec 2019
Find Reply
04-17-2020, 12:16 PM
#17
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
(04-17-2020, 11:53 AM)dstep Wrote:  Thank you for information Jan

I had problem with some IRIX patches. swmgr complains about incompatible patches in unusual way. I will make new thread for this.

About time which the building takes - I already work on this bootstap several months. Install IRIX, install IDO, install patches, problem with patches - reinstall IRIX, IDO etc... Magic ring )
The same with gnu.

Well, at least you're persistent. And that was an IP15 PowerSeries, right?

Thing is, I have such a system (4D/440 VGX). I have disks with IRIX 4.0.5 and IRIX 5.3 for it. Everything works. So it can be done.
Now, I'm not sure I want to share disc images of any of my systems, I can share a list of installed subsystems and patches, so you have a list of what to install. Is yours a VGX as well?

(04-17-2020, 11:53 AM)dstep Wrote:  Now I'm thinking about crosscompiling. I found this:
https://forums.sgi.sh/index.php?threads/...tures.194/

Cross compiling for 4.0 is doable because it uses GNU ld. If you know what you're doing you can even cross-compile the compiler itself, resulting in a native compiler (a so called Canadian cross). I wouldn't use this for anything except bootstrapping a real, native compiler, but alas. Thing is, if everything gives bus errors, what makes you think code compiled by this gcc won't?

Bootstrapping a compiler requires methodological work, small steps and lots of testing. Using a bad compiler to bootstrap the next will result in a next generation bad compiler etc. Be conservative with optimization levels. Test test test (which requires 'expect'). Compare test results with those of the previous compiler.

(04-16-2020, 01:21 PM)dstep Wrote:  all of them do Bus error. Its hard to investigate the reason via stack backtrack info in core (stripped).
Here's a 'hello world' program with debug info. It was built with GCC 4.4.2 from my FTP, with debug info. This debug info is compatible with the DBX debugger so you can use that if GDB throws bus errors itself. I'm curious where it fails.

Code:
mgras 6% dbx hello
dbx version 3.19 Nov  3 1994 19:59:46
Executable /usr/people/janjaap/hello
(dbx) l
>*  4  {
    5          printf("Hello, IRIX world!\n");
    6          return 0;
    7  }
(dbx) stop in main
Process    0: [3] stop in main
(dbx) r
Process  6136 (hello) started
[3] Process  6136 (hello) stopped at [main:5 ,0x401260]
  5  printf("Hello, IRIX world!\n");
(dbx) cont
Hello, IRIX world!
Process  6136 (hello) terminated
(dbx) quit


Attached Files
.tar hello.tar Size: 50 KB  Downloads: 255
(This post was last modified: 04-17-2020, 02:27 PM by jan-jaap.)
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
04-17-2020, 02:05 PM
#18
RE: Problem with building binutils and gcc on IRIX 5.3 little bit modern than Freeware CD
Thank you Jan
I really appreciate your help
Could you provide image of your 5.3 4D/440 VGX - dd or dump. By the way yours are EFS or XFS? I have IP15 PowerSeries 4D/420 VGXT and HDD 1.2GB and 4GB. I asked you for your patch list in my "Patch thread" ).
I do this bootstaping step by step and it takes a lot of time I know. SGI Freeware CD's binutils and gcc, I build binutils 2.9.1, gcc 2.95.3 (and a lot of other m4, make, tcl, expect....). Now I'm trying little bit modern gcc. For testing I use tcl, expect and dejagnu for binutils and gcc (make check).
Concerning stack backtrack in debugger (dbx and gdb from SGI Freeware CD I used) - I meant Bus error of your binaries gas and gcc itself but not a produced binaries. This is certainly not a complaint to you. It has been lead by different environment I'm sure.
(This post was last modified: 04-18-2020, 10:33 AM by dstep.)
dstep
O2

Trade Count: (0)
Posts: 22
Threads: 6
Joined: Dec 2019
Find Reply
04-18-2020, 10:19 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)