GCC 2.7.2.2 (simple tar format, NOT inst'able) gcc 2.7.2.2 is a full build of a native IRIX gcc, the GNU C compiler that is standalone / self-contained so you can have your basic C programs compiled and debugged without any need for a bootstrap compiler or other SGI tools.
It should work from IRIX 6.2 upwards. Please don't ask me for a 5.x version, I haven't used 5.3 in ages. It includes: gcc 2.7.2.2 plus some patches from Ralf Baechle (thanks Ralf!). The tar file includes gcc and its headers, libraries, C++ (g++) front-end and library (libg++.a), a GNU assembler from binutils, and the GNU debugger (gdb). Lastly, Two essential IDO components: the
/usr/lib/crt[1n].oruntime objects, and/usr/lib/ld(an o32 linker) are included for those who need them.If you're interested in a 5.3 version you should be aware of the fact that 5.3 didn't include headers and other parts of IDO that are necessary for compiling with gcc, if you have 5.3 and have IDO you may check one of the following:
- Kevin Cozens' instructions on how to make gcc work on IRIX 5.3.
- Scott Smith's site on: gamma.magnet.fsu.edu
Notes about this gcc:
- You would need to add
/usr/gnu/binto your path if you don't have it already:set path = (/usr/gnu/bin $path) or PATH=/usr/gnu/bin:$PATH; export PATHforcsh/tcshorsh/bash/kshrespectively.
- Users reported success building some pretty big applications, e.g. the Apache web server, bash 2.0, etc. with no problems.
- gcc and friends install under
/usr/gnu
- It does not support the n32 or 64 ABIs. i.e
gcconly produces o32/mips2 binaries.
- It uses the GNU assembler (and stabs debugging info) from binutils-2.8.1
- It uses the SGI linker (GNU binutils ld is not supported) this linker is enclosed in case you don't have it.
- It uses the SGI
libcand other runtime libraries.
- GNU binutils that silently destroy SGI compiled n32/64 binaries like
stripare not included on purpose to prevent accidents. I enclose an SGI strip binary with the linker (see below). Please don't ask me for GNU strip, I'm not going to risk you destroying your n32/64 binaries by accident.
- gdb is
gdb-4.16
- libg++ is
libg++-2.7.2
- It includes the relevant man pages (GNU
as, gdb, gcc, g++etc.)
- It includes some additional tools like
protoizeand GNUnm(needed for g++/collect2)
- It includes a basic set of ANSI-C header files (whatever is generated by the gcc build on IRIX 6.2 from the original header files.)
- gcc was tested in a limited way (including debugging) and seems to work fine. I'm not sure about g++.
- If you have IDO, you may build
gccyourself from the distribution sources.To download:
File Size (bytes) /bin/sum -rInstalls under gcc-2.7.2.2.tar.gz 611179802399 11938/usr/gnucrt1n.tar.gz (Only if needed) 154854837 4/usr/libo32ld-strip.tar.gz (Only if needed) 62932806708 1230/usr/libInstallation instructions (read this!)
You need to downloadgcc-2.7.2.2.tar.gz.
The other two archives are needed only if you don't have them.
- To install gcc and friends after downloading:
% su # mkdir -p /usr/gnu # gzcat gcc-2.7.2.2.tar.gz | ( cd /usr/gnu; tar xvf - )- The
crt1n.tar.gzarchive includes two small runtime + startup files. It is only needed if you don't have/usr/lib/crt[1n].oinstalled. If you have IDO you should already have them. Don't download or install these if you have them.-r--r--r-- root/sys 3484 Feb 27 22:12 1997 usr/lib/crt1.o -r--r--r-- root/sys 836 Feb 27 22:12 1997 usr/lib/crtn.oTo install these (only if needed) do:% su # gzcat crt1n.tar.gz | ( cd /; tar xvf - )- The
o32ld-strip.tar.gzfile includes an o32 linker and strip:-rwxr-xr-x root/sys 670944 May 28 02:16 1997 usr/lib/ld -rwxr-xr-x root/sys 154516 Jul 12 22:34 1997 usr/lib/stripAgain, it is only needed if you don't have/usr/lib/ldand/usr/lib/stripinstalled.
To install it (only if needed) do:% su # gzcat o32ld-strip.tar.gz | ( cd /; tar xvf - ) # ln -s ../lib/strip /usr/bin/strip # ln -s ../lib/ld /usr/bin/ldKnown problems / workarounds / more notes
- Missing headers (e.g.
standards.h), compilation errors etc.
IRIX 6.2 (and later) comes with a full set of headers. Before anything else - make sure you have all the SGI headers. They are not installed by default, but are on the 6.2 CD in the subsystemeoe.hdr.lib[Aside: this used to be calleddev.hdr.libin 5.3 and earlier. Unlike in 5.3, You don't need IDO to get the IRIX headers as they were moved to eoe (execution only environment)].Vanilla IRIX 6.2 may require a rollup patch which includes header file fixes to support a long list of different, and sometimes conflicting, standards (ANSI-C, POSIX-90, [1003.1a (first POSIX)], POSIX2 [1003.2 (shells & utilities)], POSIX93 [1003.1b (real-time ++)], POSIX1C [1003.1c], XOPEN, XPG4, UNIX95 [SPEC 1170] plus additional SGI and BSD extensions). If you have all the header files but are getting some type clashes make sure you have the recommended rollup patches for IRIX 6.2 (think you'll need patch 1645 for IRIX 6.2, and maybe others). This problem does not exist on IRIX 6.3 and up.
GNU preprocesses header files to be GNU compatible and does this only to a small subset of header files. It stores this subset of files under
/usr/gnu/lib/gcc-lib/.../.../include. If you compile complex stuff that uses anything beyond the ANSI standard headers and installing the full SGI headers from the IRIX CD doesn't help, then, and only then you may try to generate the missing headers from the SGI ones using the GNUfixheaderutility. Alternatively, you may try to do some tweaking, e.g. one user reported a syntax error onstruct timevalwas solved by installing the IRIXsys/time.hunder/usr/gnu/lib/gcc-lib/.../.../include/sys.Again: if you have any compilation errors that indicate missing headers or undefined types try first to get the missing headers from the IRIX CD and (if you're running IRIX 6.2) apply the recommended IRIX patches.
- In some rare cases, the GNU function prototypes may not conform to what IRIX expects. For example: the correct prototype for initstate in
stdlib.hand inmath.hshould be:extern char *initstate(unsigned int, char *, size_t);sincesize_tmay be 64 bits when you compilen32/64... This was fixed in this distribution. If your IRIX headers have different prototypes forinitstatethen you're most probaly missing some header patches (speculation: I would try patches 1466 and 1645 for 6.2) or just go ahead and fix the headers manually. This is not a problem in IRIX 6.3 or later.
- You may ignore any warnings regarding redefinitions of the constants
DBL_MAX, DBL_MIN, FLT_MAX, FLT_MINbetween/usr/include/limits.hand the GNU includefloat.h. This happens because the GNU 2.7.2.2cppis not clever enough to figure that the constants are actually the same (some simply have a trailing comment). Compiling with-wwould suppress the warnings.
- Unlike other linkers, the cool SGI linker warns about redundant libraries (i.e. librarier you link with that are not necessary), preemption of symbols in libc and maybe more. If you don't like warnings like:
"Warning 84: xx is not used to resolve any symbols"you may edit thespecsfile under/usr/gnu/lib/gcc-lib/...and add:-woff 84just before-_SYSTYPE_SVR4in thelinkspecification in that file. You may do this for any linker warning you don't like. Please note that for other types of warnings this may not be a good idea since they may potentially indicate a real problem.
- GNU
nmdoesn't find dynamic symbols written by the SGI linker, the result is a warning:a.out: no symbolsjust after the link phase (incollect2). The workaround implemented here is a small wrapper/usr/gnu/bin/gnmwhich calls the real GNU nm/usr/gnu/bin/nmwith the additional option-D. This is only FYI, this distribution takes care of this problem.
- If you have problems with
ld -rtry to use/usr/lib/old_ld -r
- The GNU assembler is significantly slower than the SGI one; If you're used to the SGI cc, expect overall vanilla compilations to be slower.
- Complex stuff that requires X-windows or graphics is unlikely to build with the included set of headers. This is not a gcc problem but is due to the fact that OpenGL or X11 development requires
dev_packages (headers and libraries). Good news: these packages are included standard in IRIX 6.5. If you have IDO, this gcc should be able to build even the most complex graphics stuff on pre IRIX 6.5 distributions.
- If you need a gcc version that supports n32/64 mips3/mips4 etc. take a look at the newer gcc 2.8.1. Be aware that it supports n32/64 only and that it requires the SGI assembler and linker (GNU binutils don't support n32/64).
Please report problems to me. If the fix is quick and easy enough there are good chances I'll be pretty responsive. No guarantee to fix anything is given though. Many thanks to Martin Knoblauch for helping this gcc build happen.