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.4 PATCH RFC: Integrate O32 ABI support into IRIX 6 configuration


This patch finally integrates support for the O32 ABI into the basic
mips-sgi-irix6 configuration.

I'm submitting this patch for initial review here, since it's not fully
tested yet.  If review would become easier, I could also split it into
several loosely related parts (some of which also touch global files, while
others are purely mips specific).

So, here it goes: the patch is created with diff -b to avoid hiding the
substance in whitespace differences.  I've tried to group the ChangeLog
entries into related groups sometimes spanning several files.

* Like the IRIX 5 patch

	http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01058.html

  it currently requrires a workaround for PR bootstrap/12173.  This is not
  included here.

* The output of gcc -print-objc-runtime-info depends on the multilib in use
  (and in fact is different between the O32 and N32/N64 ABIs), so the
  relevant flag must be passed down from config-ml.in to the libobjc
  Makefile. 

* ASM_OUTPUT_UNDEF_FUNCTION has been changed from a macro to a function
  pointer initialized at runtime depending on the ABI.  Judging from the
  comment before mips.c (mips_output_external), it might be actually
  harmless to run it for all three ABIs, leading only to superfluous but
  harmless `.global <name> .text' declarations.  I have not tried this.

* FUNCTION_NAME_ALREADY_DECLARED has been turned from a compile-time to a
  runtime test.

* Since ASM_OUTPUT_EXTERNAL_LIBCALL is now runtime-variable as well, I've
  chosen to use the new targhooks.[ch] mechanism and introduced a new
  target function targetm.asm_out.external_libcall which uses the old macro
  definition if not defined directly using TARGET_ASM_EXTERNAL_LIBCALL.
  This is all straightforward, apart from three questions:

** ASM_OUTPUT_EXTERNAL_LIBCALL is only called once in varasm.c with
   asm_out_file as first arg.  Since this is fixed, it might be useful to
   remove the FILE * arg from the target function and always provide it in
   targhooks.c (default_external_libcall)?

** Before the introduction of the target function, varasm.c
   (assemble_external_libcall) didn't do anything if
   ASM_OUTPUT_EXTERNAL_LIBCALL.  It may set SYMBOL_REF_USED (fun) now even
   for a no-op default_external_libcall.  I'm not sure if this could cause
   problems.

** This new target function still needs to be documented.  How should this
   be done while both ASM_OUTPUT_EXTERNAL_LIBCALL and
   TARGET_ASM_EXTERNAL_LIBCALL exist?  At least the former should be marked
   as deprecated.

* I've introduced new functions iris6_declare_object_name and
  iris6_finish_declare_object to incorporate the O32 handling of those
  functions.  One could instead integrate them into the generic
  mips_declare_object_name, mips_finish_declare_object functions.

* Since the native O32 assembler doesn't support named sections, I had to
  use a hack to get crtstuff.c compiled into crtbegin.o/crtend.o even for
  the O32 ABI: I saw no easy way to disable it selectively, so I did the
  following: while I could provide dummy definitions of
  [CD]TORS_SECTION_ASM_OP, the __JCR_LIST__/__JCR_END__ always used
  section(JCR_SECTION_NAME).  I've changed them like the others to
  optionally use JCR_SECTION_ASM_OP ;-)

* Since DWARF2_UNWIND_INFO now depends on the ABI in use, the definition of
  MUST_USE_SJLJ_EXCEPTIONS in except.h now needs to test for the macro
  value, not just if it's defined.

* Whether or not to use collect2 depends on the ABI: the native O32 cannot
  handle named sections, while the N32/N64 as can.  To handle both
  situations in a single compiler/collect2, I've chosen the following
  approach: use_collect2=yes is always enabled in config.gcc, but
  flag_gnu_linker is overridden in override_options, and do_collecting in a
  new hook for collect2 (COLLECT_PARSE_FLAG) which parses command line
  options and may perform special actions depending on them.  One cannot
  use target flags since they are not available to collect2.

* The remainging changes are straightforward merges of the O32 and N32/N64
  versions of several macros.  Only two issues may be worth mentioning:

** I needed to provide a O32 definition for BSS_SECTION_ASM_OP, although
   this should only be used by default_elf_select_section.  Unfortunately,
   the macro also controls the definition of mips.c
   (mips_output_aligned_bss), which gets called like this

   assemble_variable -> asm_emit_uninitialised -> asm_output_aligned_bss

   when compiling _ctors.o.  Using .data instead of .section .bss worked
   around this.

** iris6.h LINK_SPEC used to pass -call_shared -no_unresolved when no other
   conflicting (linker) options like -shared/-non_shared/-call_shared were
   given.  -r should also disable this, otherwise you get ld errors.

I'm currently running a couple of bootstraps/regressions tests to verify
this:

* unmodified mainline with native as for mips-sgi-irix6.5 (both N32 and
  N64)

* dto. for mips-sgi-irix6.5o32

* mainline with O32 integration patch and native as, for all of O32, N32,
  and N64 ABIs

Testsuite differences looked minor a couple of days ago (but not comparing
exactly the same versions of mainline), but given that regressions come and
go on an almost daily basis, it's almost impossible to tell if regressions
are introduced by my patch.

Afterwards, I'll have to perform a couple more tests:

* Building with --enable-libgcj: I haven't ever tried this for
  mips-sgi-irix6o32, so there may be nasty surprises ;-(

* Building with gas: I suppose the current patch has problems: at least,
  I'll need a definition of MDEBUG_ASM_SPECS like the one in iris5gas.h.

* Building with gas and gld, just for completeness' sake: there's a bug in
  the libtool included with gcc which I need to fix before.

What's the best way to proceed with this patch?

* Apply to mainline if the current round of testing with native as/ld and
  without libjava shows no regressions?

* Verify at least the first two configurations above (libjava and gas)?

Besides, it would be possible to apply the patch in chunks as they are
approved, and only enable it (by adding mabi=32 to MULTILIB_OPTIONS) when
the rest is done.

Comments?

There are two more things to do:

* Provide a --disable-64bit configure options so one can selectively
  disable the N64 ABI, but still retain O32/N32 on 32-bit systems.  Mostly
  done (except for libgcc, which doesn't use config-ml.in and thus doesn't
  honor this option).

* Document the new status of IRIX 5/6 support.  I'll come to this (together
  with a couple of other install.texi updates) when the rest is done.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Fri Sep 12 00:12:52 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* config-ml.in (multi-do): Pass MULTIFLAGS to subdir makes.

	libobjc:
	* Makefile.in (runtime-info.h): Use MULTIFLAGS.

	* config/mips/t-iris6 (MULTILIB_OPTIONS): Add mabi=32.
	(MULTILIB_OSDIRNAMES): Likewise.

	* config/mips/mips.c (asm_output_undef_function): New variable.
	(override_options): Initialize it.
	(mips_output_external): Test/use asm_output_undef_function at
	runtime instead of ASM_OUTPUT_UNDEF_FUNCTION at compile time.
	(mips_file_end): Likewise.
	(iris5_output_undef_function): New function. 
	* config/mips/iris5.h (ASM_OUTPUT_UNDEF_FUNCTION): Define using
	iris5_output_undef_function.
	* config/mips/iris6.h (ASM_OUTPUT_UNDEF_FUNCTION): Use
	iris5_output_undef_function for O32 ABI.
	* config/mips/mips.h (ASM_OUTPUT_UNDEF_FUNCTION): Provide default.

	* config/mips/iris6.h (FUNCTION_NAME_ALREADY_DECLARED): Define
	depending on mips_abi. 
	* config/mips/mips.c (mips_output_function_prologue): Test
	FUNCTION_NAME_ALREADY_DECLARED at runtime.
	(mips_output_function_epilogue): Likewise.
	(build_mips16_function_stub): Likewise.
	(build_mips16_call_stub): Likewise.
	* config/mips/mips.h (FUNCTION_NAME_ALREADY_DECLARED): Provide
	default.
	
	* target.h (struct gcc_target): New member external_libcall.
	* target-def.h (TARGET_ASM_EXTERNAL_LIBCALL): Provide default.
	(TARGET_ASM_OUT): Use it.
	* doc/tm.texi (TARGET_ASM_EXTERNAL_LIBCALL): Document.
	* targhooks.c: Convert to ISO C 90.
	(default_external_libcall): New function.
	* targhooks.h (default_external_libcall): Declare.
	* varasm.c (assemble_external_libcall): Use
	targetm.asm_out.external_libcall instead of
	ASM_OUTPUT_EXTERNAL_LIBCALL.
	* config/mips/mips-protos.h [TARGET_IRIX5 || TARGET_IRIX 6]
	(mips_output_external_libcall): Declare.
	* config/mips/mips.c (mips_output_external_libcall): Change
	definition guard.
	Change to match TARGET_ASM_EXTERNAL_LIBCALL.
	Only operate for O32 ABI.
	* config/mips/iris5.h (TARGET_ASM_EXTERNAL_LIBCALL): Define
	instead of ASM_OUTPUT_EXTERNAL_LIBCALL.
	* config/mips/iris6.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Don't undef,
	superceded by TARGET_ASM_EXTERNAL_LIBCALL.

	* config/mips/mips-protos.h [TARGET_IRIX6]
	(iris6_declare_object_name, iris6_finish_declare_object): Declare.
	* config/mips/mips.c [TARGET_IRIX6] (iris6_declare_object_name,
	iris6_finish_declare_object): New functions.
	* config/mips/iris6.h (ASM_DECLARE_OBJECT_NAME): Use
	iris6_declare_object_name.
	(ASM_FINISH_DECLARE_OBJECT): Use iris6_finish_declare_object.

	* config/mips/iris6.h [_MIPS_SIM == _ABIO32] (CTORS_SECTION_ASM_OP, 
	DTORS_SECTION_ASM_OP, JCR_SECTION_ASM_OP): Provide dummy definitions.
	* crtstuff.c (__JCR_LIST__): Use JCR_SECTION_ASM_OP to switch
	sections if defined.
	(__JCR_END__): Likewise.
	
	* config/mips/iris6.h (DWARF2_UNWIND_INFO): Handle native IRIX 6
	O32 assembler.
	* except.h (MUST_USE_SJLJ_EXCEPTIONS): Test for DWARF2_UNWIND_INFO
	value.

	* config.gcc (mips-sgi-irix6*): Enable use_collect2 without gas.

	* collect2.c (COLLECT_PARSE_FLAG): Provide default.
	(main): Use it.
	* doc/tm.texi (COLLECT_PARSE_FLAG): Document it.
	* config/mips/iris6.h (COLLECT_PARSE_FLAG): Define.

	* config/mips/mips.c (override_options) [USE_COLLECT2 &&
	TARGET_IRIX6]: Set flag_gnu_linker depending on ABI.
	Constructor/destructor handling depends on ABI.

	* config/mips/iris6.h (TARGET_OS_CPP_BUILTINS): Define _ABIO32,
	use it to define _MIPS_SIM for O32 ABI.
	(DWARF2_FRAME_INFO): Only define for N32/N64 ABIs.
	(ASM_DECLARE_FUNCTION_NAME): Integrate mips.h version.
	(ASM_DECLARE_FUNCTION_SIZE): Integrate O32 version.
	(SUBTARGET_ASM_SPEC): Handle -mabi=32.
	(SUBTARGET_ASM_DEBUGGING_SPEC): Add mdebug_asm_spec for gas with
	O32 ABI.
	(BSS_SECTION_ASM_OP_32): Define.
	(BSS_SECTION_ASM_OP_64): Likewise.
	(BSS_SECTION_ASM_OP): Define differently for O32 and N32/N64 ABIs
	using them.
	(ASM_OUTPUT_FILENAME): Integrate mips.h version.
	(LINK_SPEC): Only use default options -call_shared -no_unresolved
	without -r.
	Don't pass -init, -fini with -mabi=32.

	* config/mips/mips.c (override_options) [TARGET_IRIX6]: Restore
	TARGET_IRIX5 versions of TARGET_ASM_UNALIGNED_[HSD]I_OP for O32
	ABI with native assembler.
	Clear targetm.have_named_sections for the native IRIX 6 O32
	assembler. 
	Warn if -g is given for O32 ABI without gas.
	[TARGET_IRIX6] (iris6_asm_named_section): Handle O32 ABI with and
	without gas.
	(iris6_asm_output_align): Don't record alignment for O32 ABI.
	(iris6_file_start): Return early for O32 ABI.
	(iris6_file_end): Don't emit .section directives for O32 ABI.

Index: config-ml.in
===================================================================
RCS file: /cvs/gcc/gcc/config-ml.in,v
retrieving revision 1.28
diff -u -p -b -r1.28 config-ml.in
--- config-ml.in	14 Aug 2003 20:44:23 -0000	1.28
+++ config-ml.in	16 Sep 2003 14:00:09 -0000
@@ -553,6 +564,7 @@ multi-do:
 				LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
 				LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
 				LDFLAGS="$(LDFLAGS) $${flags}" \
+				MULTIFLAGS="$${flags}" \
 				DESTDIR="$(DESTDIR)" \
 				INSTALL="$(INSTALL)" \
 				INSTALL_DATA="$(INSTALL_DATA)" \
Index: gcc/collect2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/collect2.c,v
retrieving revision 1.153
diff -u -p -b -r1.153 collect2.c
--- gcc/collect2.c	19 Jul 2003 14:47:00 -0000	1.153
+++ gcc/collect2.c	16 Sep 2003 14:00:11 -0000
@@ -150,6 +150,10 @@ int do_collecting = 1;
 int do_collecting = 0;
 #endif
 
+#ifndef COLLECT_PARSE_FLAG
+#define COLLECT_PARSE_FLAG(FLAG)
+#endif
+
 /* Nonzero if we should suppress the automatic demangling of identifiers
    in linker error messages.  Set from COLLECT_NO_DEMANGLE.  */
 int no_demangle;
@@ -853,8 +857,11 @@ main (int argc, char **argv)
     int i;
 
     for (i = 1; argv[i] != NULL; i ++)
+      {
       if (! strcmp (argv[i], "-debug"))
 	debug = 1;
+	COLLECT_PARSE_FLAG (argv[i]);
+      }
     vflag = debug;
   }
 
Index: gcc/config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.357
diff -u -p -b -r1.357 config.gcc
--- gcc/config.gcc	5 Sep 2003 15:34:46 -0000	1.357
+++ gcc/config.gcc	16 Sep 2003 14:00:11 -0000
@@ -1346,6 +1349,12 @@ mips-sgi-irix6*)		# SGI System V.4., IRI
 	tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
 	target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT"
 	tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
+	# See comment in mips/iris5.h file.  Only enabled for O32 ABI
+	# without GNU as.
+	if test x$gas = xno
+	then
+		use_collect2=yes
+	fi
 #	if test x$enable_threads = xyes; then
 #		thread_file='irix'
 #	fi
Index: gcc/crtstuff.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/crtstuff.c,v
retrieving revision 1.62
diff -u -p -b -r1.62 crtstuff.c
--- gcc/crtstuff.c	7 Jun 2003 17:30:32 -0000	1.62
+++ gcc/crtstuff.c	16 Sep 2003 14:00:13 -0000
@@ -203,9 +203,16 @@ STATIC EH_FRAME_SECTION_CONST char __EH_
 #ifdef JCR_SECTION_NAME
 /* Stick a label at the beginning of the java class registration info
    so we can register them properly.  */
+#ifdef JCR_SECTION_ASM_OP
+asm (JCR_SECTION_ASM_OP);
+STATIC void *__JCR_LIST__[]
+  __attribute__ ((unused, aligned(sizeof(void*))))
+  = { };
+#else
 STATIC void *__JCR_LIST__[]
   __attribute__ ((unused, section(JCR_SECTION_NAME), aligned(sizeof(void*))))
   = { };
+#endif
 #endif /* JCR_SECTION_NAME */
 
 #ifdef INIT_SECTION_ASM_OP
@@ -450,10 +457,18 @@ STATIC EH_FRAME_SECTION_CONST int __FRAM
 
 #ifdef JCR_SECTION_NAME
 /* Null terminate the .jcr section array.  */
+#ifdef JCR_SECTION_ASM_OP
+asm (JCR_SECTION_ASM_OP);
+STATIC void *__JCR_END__[1] 
+   __attribute__ ((unused,
+		   aligned(sizeof(void *))))
+   = { 0 };
+#else
 STATIC void *__JCR_END__[1] 
    __attribute__ ((unused, section(JCR_SECTION_NAME),
 		   aligned(sizeof(void *))))
    = { 0 };
+#endif
 #endif /* JCR_SECTION_NAME */
 
 #ifdef INIT_SECTION_ASM_OP
Index: gcc/except.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.h,v
retrieving revision 1.70
diff -u -p -b -r1.70 except.h
--- gcc/except.h	29 Jun 2003 16:21:57 -0000	1.70
+++ gcc/except.h	16 Sep 2003 14:00:13 -0000
@@ -147,9 +147,13 @@ extern tree (*lang_eh_runtime_type) (tre
 	   || (DWARF2_UNWIND_INFO			\
 	       && (defined (EH_RETURN_HANDLER_RTX)	\
 		   || defined (HAVE_eh_return)))))
-#define MUST_USE_SJLJ_EXCEPTIONS	1
+# define MUST_USE_SJLJ_EXCEPTIONS	1
 #else
-#define MUST_USE_SJLJ_EXCEPTIONS	0
+# ifdef IA64_UNWIND_INFO
+#  define MUST_USE_SJLJ_EXCEPTIONS	0
+# else
+#  define MUST_USE_SJLJ_EXCEPTIONS	(DWARF2_UNWIND_INFO == 0)
+# endif
 #endif
 
 #ifdef CONFIG_SJLJ_EXCEPTIONS
Index: gcc/target-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target-def.h,v
retrieving revision 1.55
diff -u -p -b -r1.55 target-def.h
--- gcc/target-def.h	4 Sep 2003 03:17:51 -0000	1.55
+++ gcc/target-def.h	16 Sep 2003 14:00:15 -0000
@@ -166,6 +166,10 @@ Foundation, 59 Temple Place - Suite 330,
 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
 #endif
 
+#ifndef TARGET_ASM_EXTERNAL_LIBCALL
+#define TARGET_ASM_EXTERNAL_LIBCALL default_external_libcall
+#endif
+
 #define TARGET_ASM_ALIGNED_INT_OP				\
 		       {TARGET_ASM_ALIGNED_HI_OP,		\
 			TARGET_ASM_ALIGNED_SI_OP,		\
@@ -202,7 +206,8 @@ Foundation, 59 Temple Place - Suite 330,
                         TARGET_ASM_OUTPUT_MI_THUNK,             \
                         TARGET_ASM_CAN_OUTPUT_MI_THUNK,         \
                         TARGET_ASM_FILE_START,                  \
-                        TARGET_ASM_FILE_END}
+                        TARGET_ASM_FILE_END,			\
+			TARGET_ASM_EXTERNAL_LIBCALL}
 
 /* Scheduler hooks.  All of these default to null pointers, which
    haifa-sched.c looks for and handles.  */
Index: gcc/target.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target.h,v
retrieving revision 1.62
diff -u -p -b -r1.62 target.h
--- gcc/target.h	4 Sep 2003 03:17:51 -0000	1.62
+++ gcc/target.h	16 Sep 2003 14:00:15 -0000
@@ -148,6 +148,8 @@ struct gcc_target
     /* Output any boilerplate text needed at the end of a
        translation unit.  */
     void (*file_end) (void);
+
+    void (*external_libcall) (FILE *, rtx);
   } asm_out;
 
   /* Functions relating to instruction scheduling.  */
Index: gcc/targhooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/targhooks.c,v
retrieving revision 2.5
diff -u -p -b -r2.5 targhooks.c
--- gcc/targhooks.c	5 Sep 2003 02:12:29 -0000	2.5
+++ gcc/targhooks.c	16 Sep 2003 14:00:15 -0000
@@ -61,9 +61,17 @@ Software Foundation, 59 Temple Place - S
 #include "tm_p.h"
 #include "target-def.h"
 
+void
+default_external_libcall (FILE *file ATTRIBUTE_UNUSED,
+			  rtx fun ATTRIBUTE_UNUSED)
+{
+#ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
+  ASM_OUTPUT_EXTERNAL_LIBCALL(file, fun);
+#endif
+}
+
 bool
-default_promote_function_args (fntype)
-     tree fntype ATTRIBUTE_UNUSED;
+default_promote_function_args (tree fntype ATTRIBUTE_UNUSED)
 {
 #ifdef PROMOTE_FUNCTION_ARGS
   return true;
@@ -73,8 +81,7 @@ default_promote_function_args (fntype)
 }
 
 bool
-default_promote_function_return (fntype)
-     tree fntype ATTRIBUTE_UNUSED;
+default_promote_function_return (tree fntype ATTRIBUTE_UNUSED)
 {
 #ifdef PROMOTE_FUNCTION_RETURN
   return true;
@@ -84,8 +91,7 @@ default_promote_function_return (fntype)
 }
 
 bool
-default_promote_prototypes (fntype)
-     tree fntype ATTRIBUTE_UNUSED;
+default_promote_prototypes (tree fntype ATTRIBUTE_UNUSED)
 {
   if (PROMOTE_PROTOTYPES)
     return true;
Index: gcc/targhooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/targhooks.h,v
retrieving revision 2.1
diff -u -p -b -r2.1 targhooks.h
--- gcc/targhooks.h	4 Sep 2003 03:17:51 -0000	2.1
+++ gcc/targhooks.h	16 Sep 2003 14:00:15 -0000
@@ -18,6 +18,8 @@ along with GCC; see the file COPYING.  I
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
+extern void default_external_libcall (FILE *, rtx);
+
 extern bool default_promote_function_args (tree);
 extern bool default_promote_function_return (tree);
 extern bool default_promote_prototypes (tree);
Index: gcc/varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.383
diff -u -p -b -r1.383 varasm.c
--- gcc/varasm.c	9 Sep 2003 13:37:17 -0000	1.383
+++ gcc/varasm.c	16 Sep 2003 14:00:21 -0000
@@ -1629,16 +1629,14 @@ assemble_external (tree decl ATTRIBUTE_U
 /* Similar, for calling a library function FUN.  */
 
 void
-assemble_external_libcall (rtx fun ATTRIBUTE_UNUSED)
+assemble_external_libcall (rtx fun)
 {
-#ifdef ASM_OUTPUT_EXTERNAL_LIBCALL
   /* Declare library function name external when first used, if nec.  */
   if (! SYMBOL_REF_USED (fun))
     {
       SYMBOL_REF_USED (fun) = 1;
-      ASM_OUTPUT_EXTERNAL_LIBCALL (asm_out_file, fun);
+      (*targetm.asm_out.external_libcall) (asm_out_file, fun);
     }
-#endif
 }
 
 /* Assemble a label named NAME.  */
Index: gcc/config/mips/iris5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris5.h,v
retrieving revision 1.20
diff -u -p -b -r1.20 iris5.h
--- gcc/config/mips/iris5.h	14 Jul 2003 20:12:07 -0000	1.20
+++ gcc/config/mips/iris5.h	16 Sep 2003 14:00:22 -0000
@@ -184,20 +184,12 @@ do {								\
   fputs ("\n", (FILE));						\
 } while (0)
 
-/* In IRIX 5, we must output a `.global name .text' directive for every used
-   but undefined function.  If we don't, the linker may perform an optimization
-   (skipping over the insns that set $gp) when it is unsafe.  This is used
-   indirectly by ASM_OUTPUT_EXTERNAL.  */
-#define ASM_OUTPUT_UNDEF_FUNCTION(FILE, NAME)	\
-do {						\
-  fputs ("\t.globl ", FILE);			\
-  assemble_name (FILE, NAME);			\
-  fputs (" .text\n", FILE);			\
-} while (0)
+#undef ASM_OUTPUT_UNDEF_FUNCTION
+#define ASM_OUTPUT_UNDEF_FUNCTION iris5_output_undef_function
 
 /* Also do this for libcalls.  */
-#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)	\
-  mips_output_external_libcall (FILE, XSTR (FUN, 0))
+#undef TARGET_ASM_EXTERNAL_LIBCALL
+#define TARGET_ASM_EXTERNAL_LIBCALL mips_output_external_libcall
 
 /* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables.
    This is used indirectly by ASM_OUTPUT_EXTERNAL.  */
Index: gcc/config/mips/iris6.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris6.h,v
retrieving revision 1.67
diff -u -p -b -r1.67 iris6.h
--- gcc/config/mips/iris6.h	12 Aug 2003 20:50:29 -0000	1.67
+++ gcc/config/mips/iris6.h	16 Sep 2003 14:00:22 -0000
@@ -26,9 +26,10 @@ Boston, MA 02111-1307, USA.  */
 #undef MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS { "mabi=n32" }
 
-/* IRIX 6 assembler does handle DWARF2 directives.  Override setting in
-   iris5.h file.  */
+/* The IRIX 6 O32 assembler doesn't handle DWARF2 directives, while both the
+   N32/N64 assembler and gas do.  Override setting in iris5.h file.  */
 #undef DWARF2_UNWIND_INFO
+#define DWARF2_UNWIND_INFO (mips_abi == ABI_32 && !TARGET_GAS ? 0 : 1)
 
 /* The IRIX 6 assembler will sometimes assign labels to the wrong
    section unless the labels are within .ent/.end blocks.  Therefore,
@@ -86,7 +87,8 @@ Boston, MA 02111-1307, USA.  */
 							\
      if (mips_abi == ABI_32)				\
       {							\
-	builtin_define ("_MIPS_SIM=_MIPS_SIM_ABI32");	\
+	builtin_define ("_ABIO32=1");			\
+	builtin_define ("_MIPS_SIM=_ABIO32");		\
 	builtin_define ("_MIPS_SZLONG=32");		\
 	builtin_define ("_MIPS_SZPTR=32");		\
       }							\
@@ -146,7 +148,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Force the generation of dwarf .debug_frame sections even if not
    compiling -g.  This guarantees that we can unwind the stack.  */
-#define DWARF2_FRAME_INFO 1
+#define DWARF2_FRAME_INFO (mips_abi == ABI_32 && !TARGET_GAS ? 0 : 1)
 
 /* The size in bytes of a DWARF field indicating an offset or length
    relative to a debug info section, specified to be 4 bytes in the DWARF-2
@@ -175,11 +177,9 @@ Boston, MA 02111-1307, USA.  */
 #undef MACHINE_TYPE
 #define MACHINE_TYPE "SGI running IRIX 6.x"
 
-/* IRIX 5 stuff that we don't need for IRIX 6.  */
-/* ??? We do need this for the -mabi=32 switch though.  */
 #undef ASM_OUTPUT_UNDEF_FUNCTION
-#undef ASM_OUTPUT_EXTERNAL_LIBCALL
-#undef ASM_DECLARE_FUNCTION_SIZE
+#define ASM_OUTPUT_UNDEF_FUNCTION \
+  (mips_abi == ABI_32 ? iris5_output_undef_function : NULL)
 
 /* Stuff we need for IRIX 6 that isn't in IRIX 5.  */
 
@@ -189,25 +189,38 @@ Boston, MA 02111-1307, USA.  */
 #undef ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL)			\
   do {									\
+    if (mips_abi != ABI_32)						\
+      {									\
     fputs ("\t.ent\t", STREAM);						\
     assemble_name (STREAM, NAME);					\
     fputs ("\n", STREAM);						\
     assemble_name (STREAM, NAME);					\
     fputs (":\n", STREAM);						\
+      }									\
   } while (0)
 
 /* Likewise, the SGI assembler doesn't like labels after the .end, so we
    must output the .end here.  */
+#undef ASM_DECLARE_FUNCTION_SIZE
 #define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL)			\
   do {									\
+    if (mips_abi == ABI_32)						\
+      {									\
+        tree name_tree = get_identifier (NAME);				\
+        TREE_ASM_WRITTEN (name_tree) = 1;				\
+      } 								\
+    else								\
+      {									\
     fputs ("\t.end\t", STREAM);						\
     assemble_name (STREAM, NAME);					\
     fputs ("\n", STREAM);						\
+      }									\
   } while (0)
 
 /* Tell function_prologue in mips.c that we have already output the .ent/.end
    pseudo-ops.  */
-#define FUNCTION_NAME_ALREADY_DECLARED
+#undef FUNCTION_NAME_ALREADY_DECLARED
+#define FUNCTION_NAME_ALREADY_DECLARED (mips_abi != ABI_32 ? 1 : 0)
 
 #undef SET_ASM_OP	/* Has no equivalent.  See ASM_OUTPUT_DEF below.  */
 
@@ -244,7 +257,7 @@ Boston, MA 02111-1307, USA.  */
    on the mipsX option.  */
 /* If no mips[3,4] option given, give the appropriate default for mabi=X */
 #undef SUBTARGET_ASM_SPEC
-#define SUBTARGET_ASM_SPEC "%{!mabi*:-n32} %{!mips*: %{!mabi*:-mips3} %{mabi=n32|mabi=64:-mips3}}"
+#define SUBTARGET_ASM_SPEC "%{!mabi*:-n32} %{mabi=32:-32} %{!mips*: %{!mabi*:-mips3} %{mabi=32:-mips2} %{mabi=n32|mabi=64:-mips3}}"
 
 /* Must pass -g0 to the assembler, otherwise it may overwrite our
    debug info with its own debug info.  */
@@ -258,7 +271,7 @@ Boston, MA 02111-1307, USA.  */
 #define SUBTARGET_MIPS_AS_ASM_SPEC "%{v:-show} -G 0 -w"
 
 #undef SUBTARGET_ASM_DEBUGGING_SPEC
-#define SUBTARGET_ASM_DEBUGGING_SPEC "-g0"
+#define SUBTARGET_ASM_DEBUGGING_SPEC "-g0 %(mdebug_asm_spec)"
 
 /* The MIPS assembler occasionally misoptimizes.  Since GCC should be
    doing scheduling anyhow, just turn off optimization in the assembler.  */
@@ -271,7 +284,12 @@ Boston, MA 02111-1307, USA.  */
    and dtor lists this way, so we use -init and -fini to invoke the
    do_global_* functions instead of running collect2.  */
 
-#define BSS_SECTION_ASM_OP	"\t.section\t.bss"
+#define BSS_SECTION_ASM_OP_32	"\t.data"
+#define BSS_SECTION_ASM_OP_64	"\t.section\t.bss"
+#define BSS_SECTION_ASM_OP			\
+  (mips_abi != ABI_32 && mips_abi != ABI_O64	\
+   ? BSS_SECTION_ASM_OP_64			\
+   : BSS_SECTION_ASM_OP_32)
 
 #undef READONLY_DATA_SECTION_ASM_OP
 #define READONLY_DATA_SECTION_ASM_OP_32	"\t.rdata"
@@ -281,6 +299,17 @@ Boston, MA 02111-1307, USA.  */
    ? READONLY_DATA_SECTION_ASM_OP_64		\
    : READONLY_DATA_SECTION_ASM_OP_32)
 
+#if (_MIPS_SIM == _ABIO32) \
+  && ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GAS) == 0
+
+/* Fake definitions to get crtstuff.c to compile.  If we are included from
+   crtstuff.c, these need to be plain strings.  */
+#define CTORS_SECTION_ASM_OP ""
+#define DTORS_SECTION_ASM_OP ""
+#define JCR_SECTION_ASM_OP ""
+
+#endif /* _MIPS_SIM == _ABIO32 && !GAS */
+
 /* Define functions to read the name and flags of the current section.
    They are used by iris6_asm_output_align.  */
 
@@ -339,6 +368,9 @@ current_section_flags (void)						\
 #define ASM_OUTPUT_FILENAME(STREAM, NUM_SOURCE_FILENAMES, NAME) \
 do								\
   {								\
+    if (mips_abi == ABI_32)					\
+      fprintf (STREAM, "\t.file\t%d ", NUM_SOURCE_FILENAMES);	\
+    else							\
     fprintf (STREAM, "\t#.file\t%d ", NUM_SOURCE_FILENAMES);	\
     output_quoted_string (STREAM, NAME);			\
     fputs ("\n", STREAM);					\
@@ -377,10 +409,10 @@ while (0)
   (VALIST) = build_pointer_type (char_type_node)
 
 #undef ASM_DECLARE_OBJECT_NAME
-#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
+#define ASM_DECLARE_OBJECT_NAME iris6_declare_object_name
 
 #undef ASM_FINISH_DECLARE_OBJECT
-#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
+#define ASM_FINISH_DECLARE_OBJECT iris6_finish_declare_object
 
 #undef LOCAL_LABEL_PREFIX
 #define LOCAL_LABEL_PREFIX ((mips_abi == ABI_32 || mips_abi == ABI_O64) \
@@ -453,10 +485,19 @@ while (0)
 %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
 %{bestGnum} %{shared} %{non_shared} \
 %{call_shared} %{no_archive} %{exact_version} %{w} \
-%{!shared: %{!non_shared: %{!call_shared: -call_shared -no_unresolved}}} \
-%{rpath} -init __do_global_ctors -fini __do_global_dtors \
+%{!shared: %{!non_shared: %{!call_shared:%{!r: -call_shared -no_unresolved}}}} \
+%{rpath} %{!mabi=32: -init __do_global_ctors -fini __do_global_dtors} \
 %{shared:-hidden_symbol __do_global_ctors,__do_global_ctors_1,__do_global_dtors} \
 -_SYSTYPE_SVR4 -woff 131 \
 %{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
+
+/* We need to disable collecting for the N32 and N64 ABIs.  */
+#define COLLECT_PARSE_FLAG(FLAG)				\
+do {								\
+  if (! strcmp (FLAG, "-n32") || ! strcmp (FLAG, "-64"))	\
+    do_collecting = 0;						\
+  if (! strcmp (FLAG, "-32") || ! strcmp (FLAG, "-o32"))	\
+    do_collecting = 1;						\
+} while (0)
 
 #define MIPS_TFMODE_FORMAT mips_extended_format
Index: gcc/config/mips/mips-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips-protos.h,v
retrieving revision 1.49
diff -u -p -b -r1.49 mips-protos.h
--- gcc/config/mips/mips-protos.h	27 Aug 2003 07:05:17 -0000	1.49
+++ gcc/config/mips/mips-protos.h	16 Sep 2003 14:00:22 -0000
@@ -98,8 +98,12 @@ extern HOST_WIDE_INT mips_debugger_offse
 extern void print_operand (FILE *, rtx, int);
 extern void print_operand_address (FILE *, rtx);
 extern int mips_output_external (FILE *, tree, const char *);
-#ifdef ASM_OUTPUT_UNDEF_FUNCTION
-extern int mips_output_external_libcall (FILE *, const char *);
+#if TARGET_IRIX5 || TARGET_IRIX6
+extern void mips_output_external_libcall (FILE *, rtx);
+#endif
+#if TARGET_IRIX6
+extern void iris6_declare_object_name (FILE *, const char *, tree);
+extern void iris6_finish_declare_object (FILE *, tree, int, int);
 #endif
 extern void mips_output_filename (FILE *, const char *);
 extern void mips_output_lineno (FILE *, int);
Index: gcc/config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.309
diff -u -p -b -r1.309 mips.c
--- gcc/config/mips/mips.c	4 Sep 2003 09:55:30 -0000	1.309
+++ gcc/config/mips/mips.c	16 Sep 2003 14:00:23 -0000
@@ -253,6 +253,10 @@ static int mips_adjust_cost (rtx, rtx, r
 static int mips_issue_rate (void);
 static int mips_use_dfa_pipeline_interface (void);
 
+static void (*asm_output_undef_function) (FILE *, const char *);
+#if TARGET_IRIX5 || TARGET_IRIX6
+static void iris5_output_undef_function	(FILE *, const char *);
+#endif
 #ifdef TARGET_IRIX6
 static void iris6_asm_named_section_1 (const char *, unsigned int,
 				       unsigned int);
@@ -4616,6 +4620,56 @@ override_options (void)
   if (mips_abi != ABI_32 && mips_abi != ABI_O64)
     flag_pcc_struct_return = 0;
 
+#if defined(USE_COLLECT2) && TARGET_IRIX6
+  /* For IRIX 6 with integrated O32 ABI support, USE_COLLECT2 is always
+     defined when GNU as is not in use, but collect2 is only used for the
+     O32 ABI, so override the toplev.c default.
+
+     Since the IRIX 6 O32 assembler cannot handle named sections, 
+     constructor/destructor handling depends on the ABI in use.  */
+  if (mips_abi == ABI_32 && !TARGET_GAS)
+    {
+      flag_gnu_linker = 0;
+
+      targetm.have_ctors_dtors = false;
+      targetm.asm_out.constructor = NULL;
+      targetm.asm_out.destructor = NULL;
+    }
+  else
+    {
+      flag_gnu_linker = 1;
+
+      targetm.have_ctors_dtors = true;
+      targetm.asm_out.constructor = default_named_section_asm_out_constructor;
+      targetm.asm_out.destructor = default_named_section_asm_out_destructor;
+    }
+#endif
+
+#if TARGET_IRIX6
+  if (mips_abi == ABI_32 && !TARGET_GAS)
+    {
+      /* The IRIX 6 O32 assembler doesn't recognize .[248]byte, so restore
+	 the TARGET_IRIX5 definitions of TARGET_ASM_UNALIGNED_[HSD]I_OP
+	 above.  */
+      targetm.asm_out.unaligned_op.hi = "\t.align 0\n\t.half\t";
+      targetm.asm_out.unaligned_op.si = "\t.align 0\n\t.word\t";
+      targetm.asm_out.unaligned_op.di = NULL;
+
+      /* The IRIX 6 O32 assembler cannot handle named sections.  */
+      targetm.have_named_sections = false;
+
+      /* The IRIX 6 O32 assember cannot handle debug information.  */
+      if (write_symbols != NO_DEBUG)
+	{
+	  warning ("-g is only supported using GNU as with -mabi=32,");
+	  warning ("-g option disabled");
+	  write_symbols = NO_DEBUG;
+	}
+    }
+#endif
+
+  asm_output_undef_function = ASM_OUTPUT_UNDEF_FUNCTION;
+
   if ((target_flags_explicit & MASK_BRANCHLIKELY) == 0)
     {
       /* If neither -mbranch-likely nor -mno-branch-likely was given
@@ -5497,8 +5551,8 @@ mips_output_external (FILE *file ATTRIBU
       extern_head = p;
     }
 
-#ifdef ASM_OUTPUT_UNDEF_FUNCTION
-  if (TREE_CODE (decl) == FUNCTION_DECL
+  if (asm_output_undef_function &&
+      TREE_CODE (decl) == FUNCTION_DECL
       /* ??? Don't include alloca, since gcc will always expand it
 	 inline.  If we don't do this, the C++ library fails to build.  */
       && strcmp (name, "alloca")
@@ -5512,24 +5566,24 @@ mips_output_external (FILE *file ATTRIBU
       p->size = -1;
       extern_head = p;
     }
-#endif
 
   return 0;
 }
 
-#ifdef ASM_OUTPUT_UNDEF_FUNCTION
-int
-mips_output_external_libcall (FILE *file ATTRIBUTE_UNUSED, const char *name)
+#if TARGET_IRIX5 || TARGET_IRIX6
+void
+mips_output_external_libcall (FILE *file ATTRIBUTE_UNUSED, rtx fun)
 {
   register struct extern_list *p;
 
+  if (mips_abi == ABI_32)
+    {
   p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list));
   p->next = extern_head;
-  p->name = name;
+      p->name = XSTR (fun, 0);
   p->size = -1;
   extern_head = p;
-
-  return 0;
+    }
 }
 #endif
 
@@ -5778,11 +5832,9 @@ mips_file_end (void)
 	  if (! TREE_ASM_WRITTEN (name_tree))
 	    {
 	      TREE_ASM_WRITTEN (name_tree) = 1;
-#ifdef ASM_OUTPUT_UNDEF_FUNCTION
-	      if (p->size == -1)
-		ASM_OUTPUT_UNDEF_FUNCTION (asm_out_file, p->name);
+	      if (asm_output_undef_function && p->size == -1)
+		(*asm_output_undef_function) (asm_out_file, p->name);
 	      else
-#endif
 		{
 		  fputs ("\t.extern\t", asm_out_file);
 		  assemble_name (asm_out_file, p->name);
@@ -6498,9 +6550,7 @@ save_restore_insns (int store_p, rtx lar
 static void
 mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
 {
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
   const char *fnname;
-#endif
   HOST_WIDE_INT tsize = cfun->machine->frame.total_size;
 
   /* ??? When is this really needed?  At least the GNU assembler does not
@@ -6522,7 +6572,8 @@ mips_output_function_prologue (FILE *fil
       && current_function_args_info.fp_code != 0)
     build_mips16_function_stub (file);
 
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
+  if (!FUNCTION_NAME_ALREADY_DECLARED)
+    {
   /* Get the function name the same way that toplev.c does before calling
      assemble_start_function.  This is needed so that the name used here
      exactly matches the name used in ASM_DECLARE_FUNCTION_NAME.  */
@@ -6537,7 +6588,7 @@ mips_output_function_prologue (FILE *fil
 
   assemble_name (file, fnname);
   fputs (":\n", file);
-#endif
+    }
 
   if (!flag_inhibit_size_directive)
     {
@@ -6992,8 +7043,7 @@ mips_output_function_epilogue (FILE *fil
       set_noreorder = set_nomacro = 0;
     }
 
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
-  if (!flag_inhibit_size_directive)
+  if (!FUNCTION_NAME_ALREADY_DECLARED && !flag_inhibit_size_directive)
     {
       const char *fnname;
 
@@ -7005,7 +7055,6 @@ mips_output_function_epilogue (FILE *fil
       assemble_name (file, fnname);
       fputs ("\n", file);
     }
-#endif
 
   while (string_constants != NULL)
     {
@@ -7890,11 +7939,12 @@ build_mips16_function_stub (FILE *file)
 
   /* ??? If FUNCTION_NAME_ALREADY_DECLARED is defined, then we are
      within a .ent, and we can not emit another .ent.  */
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
+  if (!FUNCTION_NAME_ALREADY_DECLARED)
+    {
   fputs ("\t.ent\t", file);
   assemble_name (file, stubname);
   fputs ("\n", file);
-#endif
+    }
 
   assemble_name (file, stubname);
   fputs (":\n", file);
@@ -7920,11 +7970,12 @@ build_mips16_function_stub (FILE *file)
 
   fprintf (file, "\t.set\treorder\n");
 
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
+  if (!FUNCTION_NAME_ALREADY_DECLARED)
+    {
   fputs ("\t.end\t", file);
   assemble_name (file, stubname);
   fputs ("\n", file);
-#endif
+    }
 
   fprintf (file, "\t.set\tmips16\n");
 
@@ -8119,14 +8170,15 @@ build_mips16_call_stub (rtx retval, rtx 
       fprintf (asm_out_file, "\t.set\tnomips16\n");
       assemble_start_function (stubdecl, stubname);
 
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
+      if (!FUNCTION_NAME_ALREADY_DECLARED)
+	{
       fputs ("\t.ent\t", asm_out_file);
       assemble_name (asm_out_file, stubname);
       fputs ("\n", asm_out_file);
 
       assemble_name (asm_out_file, stubname);
       fputs (":\n", asm_out_file);
-#endif
+	}
 
       /* We build the stub code by hand.  That's the only way we can
 	 do it, since we can't generate 32 bit code during a 16 bit
@@ -8193,11 +8245,12 @@ build_mips16_call_stub (rtx retval, rtx 
       ASM_DECLARE_FUNCTION_SIZE (asm_out_file, stubname, stubdecl);
 #endif
 
-#ifndef FUNCTION_NAME_ALREADY_DECLARED
+      if (!FUNCTION_NAME_ALREADY_DECLARED)
+	{
       fputs ("\t.end\t", asm_out_file);
       assemble_name (asm_out_file, stubname);
       fputs ("\n", asm_out_file);
-#endif
+	}
 
       fprintf (asm_out_file, "\t.set\tmips16\n");
 
@@ -9550,7 +9603,38 @@ mips_emit_prefetch (rtx *operands)
 
 
 
+#if TARGET_IRIX5 || TARGET_IRIX6
+/* In IRIX 5, we must output a `.global name .text' directive for every used
+   but undefined function.  If we don't, the linker may perform an optimization
+   (skipping over the insns that set $gp) when it is unsafe.  This is used
+   indirectly by ASM_OUTPUT_EXTERNAL.  */
+static void
+iris5_output_undef_function (FILE *file, const char *name)
+{
+  fputs ("\t.globl ", file);
+  assemble_name (file, name);
+  fputs (" .text\n", file);
+}
+
+#endif /* TARGET_IRIX5 || TARGET_IRIX6 */
+
 #ifdef TARGET_IRIX6
+void
+iris6_declare_object_name (FILE *stream, const char *name, tree decl)
+{
+  if (mips_abi == ABI_32 && !TARGET_GAS)
+    mips_declare_object (stream, name, "", ":\n", 0);
+  else
+    mips_declare_object_name (stream, name, decl);
+}
+
+void
+iris6_finish_declare_object (FILE *stream, tree decl, int top_level, int at_end)
+{
+  if (mips_abi != ABI_32 || TARGET_GAS)
+    mips_finish_declare_object (stream, decl, top_level, at_end);
+}
+
 /* Output assembly to switch to section NAME with attribute FLAGS.  */
 
 static void
@@ -9589,6 +9673,14 @@ iris6_asm_named_section_1 (const char *n
 static void
 iris6_asm_named_section (const char *name, unsigned int flags)
 {
+  if (mips_abi == ABI_32)
+    {
+      if (!TARGET_GAS)
+	default_no_named_section (name, flags);
+      else
+	default_elf_asm_named_section (name, flags);
+    }
+  else
   iris6_asm_named_section_1 (name, flags, 0);
 }
 
@@ -9627,6 +9719,8 @@ iris6_asm_output_align (FILE *file, unsi
   const char *section = current_section_name ();
   struct iris_section_align_entry **slot, *entry;
 
+  if (mips_abi != ABI_32)
+    {
   if (! section)
     abort ();
 
@@ -9645,6 +9739,7 @@ iris6_asm_output_align (FILE *file, unsi
     }
   else if (entry->log < log)
     entry->log = log;
+    }
 
   fprintf (file, "\t.align\t%u\n", log);
 }
@@ -9659,6 +9754,9 @@ iris6_file_start (void)
 {
   mips_file_start ();
 
+  if (mips_abi == ABI_32)
+    return;
+
   iris_orig_asm_out_file = asm_out_file;
   asm_out_file = tmpfile ();
 
@@ -9699,6 +9797,8 @@ copy_file_data (FILE *to, FILE *from)
 static void
 iris6_file_end (void)
 {
+  if (mips_abi != ABI_32)
+    {
   /* Emit section directives with the proper alignment at the top of the
      real output file.  */
   FILE *temp = asm_out_file;
@@ -9707,6 +9807,7 @@ iris6_file_end (void)
 
   /* Copy the data emitted to the temp file to the real output file.  */
   copy_file_data (asm_out_file, temp);
+    }
 
   mips_file_end ();
 }
Index: gcc/config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.289
diff -u -p -b -r1.289 mips.h
--- gcc/config/mips/mips.h	4 Sep 2003 09:55:33 -0000	1.289
+++ gcc/config/mips/mips.h	16 Sep 2003 14:00:25 -0000
@@ -3299,6 +3299,9 @@ while (0)
 #define ASM_OUTPUT_EXTERNAL(STREAM,DECL,NAME) \
   mips_output_external(STREAM,DECL,NAME)
 
+#ifndef ASM_OUTPUT_UNDEF_FUNCTION
+#define ASM_OUTPUT_UNDEF_FUNCTION NULL
+#endif
 
 /* This is how to declare a function name.  The actual work of
    emitting the label is moved to function_prologue, so that we can
@@ -3308,6 +3311,10 @@ while (0)
 
 #undef ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL)
+
+#ifndef FUNCTION_NAME_ALREADY_DECLARED
+#define FUNCTION_NAME_ALREADY_DECLARED 0
+#endif
 
 /* This is how to store into the string LABEL
    the symbol_ref name of an internal numbered label where
Index: gcc/config/mips/t-iris6
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/t-iris6,v
retrieving revision 1.18
diff -u -p -b -r1.18 t-iris6
--- gcc/config/mips/t-iris6	1 Apr 2003 21:45:28 -0000	1.18
+++ gcc/config/mips/t-iris6	16 Sep 2003 14:00:25 -0000
@@ -1,10 +1,9 @@
 # ??? If no mabi=X option given, but a mipsX option is, then should deal
 # with that.
-# ??? mabi=32 is deliberately left off the list because it doesn't work yet.
-MULTILIB_OPTIONS=mabi=n32/mabi=64
+MULTILIB_OPTIONS=mabi=32/mabi=n32/mabi=64
 MULTILIB_DIRNAMES=
 MULTILIB_MATCHES=
-MULTILIB_OSDIRNAMES=. mabi=64
+MULTILIB_OSDIRNAMES=mabi=32 . mabi=64
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
Index: gcc/doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.255
diff -u -p -b -r1.255 tm.texi
--- gcc/doc/tm.texi	4 Sep 2003 03:18:03 -0000	1.255
+++ gcc/doc/tm.texi	16 Sep 2003 14:00:28 -0000
@@ -7140,6 +7140,12 @@ This macro is effective only in a native
 part of a cross compiler always uses @command{nm} for the target machine.
 @end defmac
 
+@defmac COLLECT_PARSE_FLAG (@var{flag})
+Define this macro to be C code that examines @command{collect2} command
+line option @var{flag} and performs special actions if
+@command{collect2} needs to behave differently depending on @var{flag}.
+@end defmac
+
 @defmac REAL_NM_FILE_NAME
 Define this macro as a C string constant containing the file name to use
 to execute @command{nm}.  The default is to search the path normally for
Index: libobjc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libobjc/Makefile.in,v
retrieving revision 1.25
diff -u -p -b -r1.25 Makefile.in
--- libobjc/Makefile.in	28 Aug 2003 01:15:06 -0000	1.25
+++ libobjc/Makefile.in	16 Sep 2003 14:01:28 -0000
@@ -162,7 +162,7 @@ OBJS_GC = archive_gc.lo class_gc.lo enco
 runtime-info.h: 
 	echo "" > tmp-runtime
 	echo "/* This file is automatically generated */" > $@
-	$(CC1OBJ) -print-objc-runtime-info tmp-runtime >> $@
+	$(CC1OBJ) $(MULTIFLAGS) -print-objc-runtime-info tmp-runtime >> $@
 	rm -f tmp-runtime
 
 archive_gc.lo: archive.c


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