Porting Software to IRIX: Difference between revisions

From TechPubs Wiki

Created page with "Porting software to IRIX can seem like a massive task, and while it is, it's not impossible even for a beginner. == Getting Started == Make sure the machine is up to the task of installation. Compiling produces a lot of heat, wears hard disks and stresses system resources. Recommended specs to build: * CPU: Building on anything slower than an R5000 at 150MHz can be painful. But most packages can be built in parallel, so seek out an Origin 200, dual CPU Octane,..."
 
No edit summary
 
Line 64: Line 64:
* optimizations performed.
* optimizations performed.


[[Categories: Tutorials]]
[[Category: Tutorials]]

Latest revision as of 20:05, 26 February 2025

Porting software to IRIX can seem like a massive task, and while it is, it's not impossible even for a beginner.

Getting Started

Make sure the machine is up to the task of installation. Compiling produces a lot of heat, wears hard disks and stresses system resources. Recommended specs to build:

  • CPU: Building on anything slower than an R5000 at 150MHz can be painful. But most packages can be built in parallel, so seek out an Origin 200, dual CPU Octane, or Origin 300 as an entry level build machine.
  • RAM: No less than 128M, and at least 1GB for best results. Enable a swap file as well to prevent crashes during compiling (2-3x system memory)
  • Hard disks: Do not use antique low speed single ended drives if at all possible. Try to use NOS drives. Or use an NFS share to offload the I/O.

Determine Dependencies

There's three sources to use for this:

  • Freshports. Without a doubt, freshports.org is the best visual resource for build and runtime dependencies. It even can shed light into tunables
  • Linux From Scratch. A good secondary option.
  • Package documentation. Sometimes this is hard to find/obscure.

Rule out Programs Unsuitable for IRIX

This list is entirely editorial in nature, not objective:

  • Rust/C++17 and up. Rust is currently not considered functional or stable on IRIX. C++17 is not a deal breaker, but it can point to poorer program optimization, impossible to port dependencies or other caveats.
  • FreeDesktop Tools: Consolekit, Policykit, dbus, etc. these are GNU/Linux-developed and optimized and may be unsuitable for IRIX.
  • Java: Java on IRIX is limited to version 1.4 as of 2025.
  • GTK3, QT5: Newer toolkits can be extremely CPU taxing.
  • Firefox/Chromium: MIPS is not a well supported platform.

Write a dependency tree

Determine what depends on what and what order things need to be installed and in what order. Check against the packaging system being used (or if in lieu, write a full tree).

Build dependencies, patching and packaging

Build the dependencies in order, patching as necessary and if necessary packaging.

Porting process

Choose compiler

  • MIPSPro - Native system compiler for C99 and C++98/03. Necessary to link against system libraries using C++ (libfam, libviewkit, libinst.so etc)
  • GCC - C/C++ compilers available.

Attempt to build

Should compiler errors or problems be encountered, contact the IRIXNet and SGUG forums for insight and assistance.

Patch Coding errors

Keep an original copy of the source tree for comparison and to roll back changes as necessary.

Linking Stage

IRIX's ld linker sometimes requires -l or static libs to be linked in a specific order else some symbols won't get resolved properly. This can take some fiddling. Check the makefile for _LIBS variables to shuffle the order.

Checks

Run any testsuites, verify operation of program.

Optimization

Better performance can be achieved via optimization. Some specific flags for GCC and MIPSPro are below:

  • MIPSPro: -TARG:proc=r10000 - optimizes for R10000 CPUs (can do for R4000, R5000, R8000 as well as specific systems with platform=IPXX), -INLINE:all - This forces all functions eligible for inlining to be inlined. This can cause code size to increase, causing cache pressure. -INLINE:dfe=on turns on dead function elimination optimizations. -IPA turns on various kinds of interprocedural analysis.
  • GCC: -march=r10000 is roughly equivalent to -TARG. -mno-fp-exceptions disables fp exceptions. -fomit-frame-pointer has no real noticeable effect on IRIX.

Documenting the process

Keep in mind that the following things are necessary to be documented for replicability:

  • Software Version
  • Environmental flags
  • flags passed to configure, Cmake etc.
  • Patches for code.
  • optimizations performed.