This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

3.1.1 PATCH: Need to force mips3 ISA in IRIX 6 bootstrap compiler


Bootstrapping gcc 3.1 on an MIPS R8000 IRIX 6.5 system, I noticed that the
resulting binaries all used the mips4 ISA, although gcc creates N32/mips3
code by default.  I could track this down to using gcc 2.95 as a bootstrap
compiler: while the compiler correctly creates mips3 code, on R8000 (and
R5000, R10000) systems /bin/as defaults to N32/mips4 unless the mips3 ISA
is explicitly specified.  This gave me a mips4 libiberty.a and all programs
linked against -liberty became mips4, too.  Thus I was unable to run the
resulting gcc on an R4400 system.

The following patch documents this possible pitfall and a workaround.

Tested with make gccinstall.dvi gccinstall.info.

Ok for branch and mainline?

	Rainer


Fri May 17 13:45:51 2002  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* doc/install.texi (Specific, mips-sgi-irix6): Document need to
	bootstrap with -mips3.

Index: install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.117
diff -u -p -r1.117 install.texi
--- install.texi	16 May 2002 22:15:53 -0000	1.117
+++ install.texi	17 May 2002 16:44:33 -0000
@@ -3178,6 +3178,27 @@ test.o: ELF 64-bit MSB @dots{}
 then your version of @command{cc} uses the O32 or N64 ABI by default.  You
 should set the environment variable @env{CC} to @samp{cc -n32}
 before configuring GCC@.
+
+If you want the resulting @command{gcc} to run on old 32-bit systems
+with the MIPS R4400 CPU, you need to ensure that only code for the mips3
+instruction set architecture (ISA) is generated.  While GCC 3.x does
+this correctly, both GCC 2.95 and SGI's MIPSpro @command{cc} may change
+the ISA depending on the machine where GCC is built.  Using one of them
+as the bootstrap compiler may result in mips4 code, which won't run at
+all on mips3-only systems.  For the test program above, you should see:
+
+@example
+test.o: ELF N32 MSB mips-3 @dots{}
+@end example
+
+If you get:
+
+@example
+test.o: ELF N32 MSB mips-4 @dots{}
+@end example
+
+instead, you should set the environment variable @env{CC} to @samp{cc
+-n32 -mips3} or @samp{gcc -mips3} respectively before configuring GCC@.
 
 GCC on IRIX 6 is usually built to support both the N32 and N64 ABIs.  If
 you build GCC on a system that doesn't have the N64 libraries installed,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]