This is gcc 2.8.1. A recent version of the GNU C compiler.
gcc-2.8.1: description + notes
In addition to gcc, it includes g++ and objective-c (objc) language front-ends, plus the
protoize/unprotoize
andgcov
utilities.To be useful,
g++
requires a C++ standard library which is not included in this package. If you do C++ development you should also install thelibstdc++
package.gcc version 2.8 and upwards supports SGI's new ABIs
(n32 and 64)
. The default compilation mode is n32(-mabi=n32)
. To compile 64-bit use:gcc -mabi=64 ...
NOTE:
This gcc requires the SGI back-end (assembler and linker) since the GNU back-end (binutils) doesn't yet support the new SGI ABIs.The SGI back end (including an assembler and linker supporting the
n32
and64
ABIs) plus all the bits and pieces needed for gcc (headers, libraries, runtime startup files, etc.) are included for free with any IRIX 6.5 distribution on the 2 CDs titled Development Foundation and Development Libraries (in other words you don't need to have the SGI IDO in order to use gcc.) In recent SGI compiler releases, the SGI assembler and linker are in the subsystem:compiler_dev.sw.base
.
Troubleshooting (symptom/resolution items)
ld32: FATAL 9: I/O error (/usr/lib32/mips3/crt1.o): No such file or directory.
- You haven't installed all the necessary pieces from the Development Libraries CD. Specifically:
/usr/lib32/mips3/crt1.o
is in the dev.sw.lib subsystem on that CD or equivalent.
file.c:1: stdio.h: No such file or directory
- You haven't installed the IRIX standard headers. You may find them in IRIX inside
irix_dev.sw.headers
or in the compiler/development CD incompiler_dev.hdr.lib
.
/usr/include/string.h:67: warning: conflicting types for built-in function `memcpy' (or memcmp/memset/strlen)
- When you compile with the
-mips3
option you should suppress the gcc builtins i.e.:
gcc -fno-builtin -mips3 ...
Assembler messages:
Fatal error: No compiled in support for 64 bit object file format
- You're running gcc 2.8.1 in 64-bit mode
(gcc -mabi=64)
but using the GNU assembler which doesn't support the 64-bit abi. Make sure thatas
in your PATH is the SGI assembler rather than the GNU assembler. You may rename the GNU assembler togas
to prevent this.
as: unrecognized option `-n32'
- Again, you're running the GNU assembler rather than the SGI assembler.
The most probable reason is that you have an older version of the GNU compiler (gcc 2.7.x) and binutils installed in your PATH
(/usr/freeware/bin/as
or/usr/gnu/bin/as)
. To verify this rungcc
with the-v
option and see which assembler(as)
is being called.Two possible fixes:
- Rename the gnu assembler under
/usr/freeware/bin
or/usr/gnu/bin
togas
(best if you still want to keep gcc 2.7.x and the o32 ABI GNU capability)- Remove the old GNU
as
altogether.
ld: FATAL 43: cannot mix PIC and non-PIC: ...
- You are trying to mix PIC and non-PIC code, most probably by an incorrect use of
-Bstatic
. Note that on new IRIX systems, archives (.a files) are not statically linked objects but archives of dynamically linked objects. People tend to say "I want static linking" when they actually mean: "I want to use a.a
library instead of a.so
library."Anyway: the correct way of mixing statically linked code with dynamically linked code is to alternate the mode of linking between libraries. Here's an example of the correct way to link with the GTK+ libraries:
gcc -o foo foo.o \ -L/path/to/gtk/lib -Wl,-B,static -lgtk -lgdk -lglib \ -Wl,-B,dynamic -lXext -lX11 -lmNote the switching between dynamic linking (default) to static linking with some freeware libraries(-lgtk -lgdk -lglib)
and back to dynamic linking with the SGIX11
andlibm
libraries.(Many thanks to Erik Mouw for this one)
ld: FATAL 9: I/O error (-lc): No such file or directory
ld: FATAL 9: I/O error (-lm): No such file or directory
- Basically: the linker cannot find your standard C (or math) library. The reasons may vary. You may be on a IRIX 6.2 system but you haven't installed the n32 libraries (
eoe.sw32.lib
for the IRIX CD.) This is the most common cause. Or you may be compiling with-mabi=64
but you don't have the 64-bit libraries installed on your system. You may otherwise have some bad seetings for environment variables that affect the search for DSOs such asLD_LIBRARY_PATH, _RLD_ROOT
, etc. Seeman dso
. Try to run gcc with the-v
option to see which linker is being called (e.g. does it get invoked with -n32 ?). This may help figuring out the problem
Known Bugs
If you wish to build gcc 2.8.1 from source you may use these instructions (Thanks Erik Mouw!).
- Unlike the SGI cc, gcc 2.8.1 does not support the o32 (old 32 bit) ABI.
- Unlike the SGI cc, gcc 2.8.1 does not seem to support 128-bit quantities like long double and long long on MIPS.
[From Jim Wilson]
Gcc does not correctly pass/return structures which are smaller than 16 bytes and which are not 8 bytes. The problem is very involved and difficult to fix. It affects a number of other targets also, but irix6 is affected the most, because it is a 64 bit target, and 4 byte structures are common. The exact problem is that structures are being padded at the wrong end, e.g. a 4 byte structure is loaded into the lower 4 bytes of the register when it should be loaded into the upper 4 bytes of the register.Gcc is consistent with itself, but not consistent with the SGI C compiler [and the SGI supplied runtime libraries], so the only failures that can happen are when there are library functions that take/return such structures. There are very few such library functions. I can only recall seeing a few of them:
inet_ntoa, inet_aton, inet_lnaof, inet_netof
, andsemctl
.A possible workaround: if you have a program that calls
inet_ntoa
and friends orsemctl
, and your kernel supports 64-bit binaries (i.e.uname -a
printsIRIX64
rather than justIRIX
), then you may compile withgcc -mabi=64
to workaround this problem.If you wish to report a problem, always make sure to include enough details (exact invocation line, full error message) so we can figure it out.
Built and tested by Ariel Faigon, Aug 1998.
Hearty thanks to Erik Mouw and Martin Knoblauch.
To auto-install this package, go back and click on the respective install icon.