Reinstating SGI linker in GCC

SolusRaion

Member
Jan 3, 2025
63
26
18
Using patches provided by SGUG, didbs, others, I've been unable to reenable SGI linker support in any GCC version past 4.7.4

The reason I want to do this is simple:

GNU Binutils does have some known bugs and limitations. and because LTO will never properly work, I'd rather attempt to keep SGI linker working because it doesn't have the need for --allow-shlib-undefined among other issues.

If at all possible, can someone help point me where I need to go in the GCC src to look into this? gonna probably end up asking the GCC dev Rainer orth but I'd rather know if anyone else has ideas.

For reference, this is also related to fixing multilib.
 
Makes sense, Binutils can be a pain. Have you checked if any SGUG or didbs patches touch LTO stuff.
 
SGUG and didbs patches do the bare minimum to reinstate IRIX support. If you attempt to build any version after 4.7 as-is, it'll fail part way through the first stage with overflow errors with the sgi linker.

Binutils can build most stuff fine, but it has some symbol resolution issues and for someone like me building a dual-MIPSPro/GCC chain, it is a pain.

LTO will never work proper on IRIX because MIPS is a small-code ABI that uses a single 16-bit sized instruction for the GOT. LTO dramatically increases that size, breaking stuff.
 
Some info from Rainer Orth, who maintained SGI GCC:

> You don't need to do anything special to use the native linker. When Ilook at my IRIX test results, I've only built gcc with ld on IRIX 6.5.The only remaining test log that used gld is for IRIX 5.3.The code that depends on the ld vs. gld distinction is guarded byIRIX_USING_GNU_LD, as can be seen in gcc/config.gcc (mips-sgi-irix6.5*)and gcc/config/mips/iris6.h. I don't remember what the problems withgld were that prompted me to stay with ld instead. The linker used isselected based on the --with-ld=<path to ld> --with{,out}-gnu-ldswitches, the default being the SGI ld. You should find all thenecessary information in the mips-sgi-irix6 section ofgcc/doc/install.texi.

> There is no such configuration [in regards to an n64 ABI binary with multilib]: when you check ports that *do* support32-bit-default and 64-bit-default variants (like Solaris and Linux),you'll see that considerable effort is necessary in the configury tosupport that. Given that only some of the IRIX boxes I had at mydisposal back then were able to run 64-bit kernels, there seemed littlepoint in an effort to create such configurations for IRIX, too. I'vealways shared my GCC installations via NFS to the test systems, andbuilding and installing two different versions for just 3 boxes seemedlike a total waste of time.

I'll poke at this sooner or later.
 
  • Like
Reactions: stormy

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu