From 59267987dbc7bc330557f4fdfdb574fc797f6c84 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Fri, 19 Jul 2002 21:58:12 +0000 Subject: [PATCH] iris5gas.h (DWARF2_DEBUGGING_INFO): Define. * config/mips/iris5gas.h (DWARF2_DEBUGGING_INFO): Define. (PREFERRED_DEBUGGING_TYPE): Use DWARF2_DEBUG. (LINK_SPEC): Define. (STARTFILE_SPEC): Define. (ENDFILE_SPEC): Define. * config/mips/iris6-o32.h (LINK_SPEC): Move ... * config/mips/iris6-o32-as.h (LINK_SPEC): ... here. * config/mips/iris6-o32-gas.h: New file. * config.gcc (mips-sgi-irix6*o32): Use it. * config/mips/t-iris5-gas: New file. * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Use it. From-SVN: r55596 --- gcc/ChangeLog | 17 +++++++++++++++++ gcc/config.gcc | 4 +++- gcc/config/mips/iris5gas.h | 32 +++++++++++++++++++++++++++++++- gcc/config/mips/iris6-o32-as.h | 16 ++++++++++++++++ gcc/config/mips/iris6-o32-gas.h | 19 +++++++++++++++++++ gcc/config/mips/iris6-o32.h | 16 ---------------- gcc/config/mips/t-iris5-gas | 5 +++++ 7 files changed, 91 insertions(+), 18 deletions(-) create mode 100644 gcc/config/mips/iris6-o32-gas.h create mode 100644 gcc/config/mips/t-iris5-gas diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0dea73ba5b..2e8b734631e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2002-07-19 Rainer Orth + + * config/mips/iris5gas.h (DWARF2_DEBUGGING_INFO): Define. + (PREFERRED_DEBUGGING_TYPE): Use DWARF2_DEBUG. + (LINK_SPEC): Define. + (STARTFILE_SPEC): Define. + (ENDFILE_SPEC): Define. + + * config/mips/iris6-o32.h (LINK_SPEC): Move ... + * config/mips/iris6-o32-as.h (LINK_SPEC): ... here. + + * config/mips/iris6-o32-gas.h: New file. + * config.gcc (mips-sgi-irix6*o32): Use it. + + * config/mips/t-iris5-gas: New file. + * config.gcc (mips-sgi-irix6*o32, mips-sgi-irix5*): Use it. + 2002-07-19 Neil Booth * cppexp.c (ALWAYS_EVAL): Remove. diff --git a/gcc/config.gcc b/gcc/config.gcc index e33752b81ce..a80b2ce712d 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1748,11 +1748,12 @@ mcore-*-pe*) mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI if test x$gas = xyes then - tm_file="mips/iris5.h mips/iris5gas.h" + tm_file="mips/iris5.h mips/iris5gas.h mips/iris6-o32-gas.h" if test x$stabs = xyes then tm_file="${tm_file} dbx.h" fi + tmake_file=mips/t-iris5-gas else tm_file="mips/iris5.h mips/iris6-o32-as.h" tmake_file=mips/t-iris5-as @@ -1826,6 +1827,7 @@ mips-sgi-irix5*) # SGI System V.4., IRIX 5 then tm_file="${tm_file} dbx.h" fi + tmake_file=mips/t-iris5-gas else tm_file=mips/iris5.h tmake_file=mips/t-iris5-as diff --git a/gcc/config/mips/iris5gas.h b/gcc/config/mips/iris5gas.h index b8ac642f3b8..a4985db87a5 100644 --- a/gcc/config/mips/iris5gas.h +++ b/gcc/config/mips/iris5gas.h @@ -2,14 +2,44 @@ /* Enable debugging. */ #define DBX_DEBUGGING_INFO +#define DWARF2_DEBUGGING_INFO #define SDB_DEBUGGING_INFO #define MIPS_DEBUGGING_INFO -#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG +#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG /* GNU as does handle DWARF2 directives. */ #undef DWARF2_UNWIND_INFO #define DWARF2_UNWIND_INFO 1 +/* Override iris5.h version to invoke [cd]tors and register eh frame + information. */ +#undef LINK_SPEC +#define LINK_SPEC "\ +%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \ +%{bestGnum} %{shared} %{non_shared} \ +%{call_shared} %{no_archive} %{exact_version} \ +%{static: -non_shared} \ +%{!static: \ + %{!shared:%{!non_shared:%{!call_shared: -call_shared -no_unresolved}}}} \ +%{rpath} -init __do_global_ctors -fini __do_global_dtors \ +%{shared:-hidden_symbol __do_global_ctors,__do_global_ctors_1,__do_global_dtors} \ +-_SYSTYPE_SVR4" + +/* Override iris5.h versions to include crtbegin.o and crtend.o. */ + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "\ +%{!static: \ + %{!shared:%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}}} \ +%{static: \ + %{pg:gcrt1.o%s} \ + %{!pg:%{p:/usr/lib/nonshared/mcrt1.o%s libprof1.a%s} \ + %{!p:/usr/lib/nonshared/crt1.o%s}}} \ +crtbegin.o%s" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend.o%s %{!shared:crtn.o%s}" + /* Irix 5 does not have some strange restrictions that Irix 3 had. */ #undef SET_FILE_NUMBER #define SET_FILE_NUMBER() ++num_source_filenames diff --git a/gcc/config/mips/iris6-o32-as.h b/gcc/config/mips/iris6-o32-as.h index 8e975efd757..6aafc7683d7 100644 --- a/gcc/config/mips/iris6-o32-as.h +++ b/gcc/config/mips/iris6-o32-as.h @@ -11,3 +11,19 @@ #define SUBTARGET_ASM_OPTIMIZING_SPEC "\ %{noasmopt:-O0} \ %{!noasmopt:%{O|O1|O2|O3:-O2}}" + +/* Enforce use of O32 linker, irrespective of SGI_ABI environment variable + and machine type (e.g., R8000 systems default to -64). Copied from + iris5.h, only adding -32. The default options -call_shared -no_unresolved + are only passed if not invoked with -r. */ +#undef LINK_SPEC +#define LINK_SPEC "\ +%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \ +%{bestGnum} %{shared} %{non_shared} \ +%{call_shared} %{no_archive} %{exact_version} \ +%{static: -non_shared} \ +%{!static: \ + %{!shared:%{!non_shared:%{!call_shared:%{!r: -call_shared -no_unresolved}}}}} \ +%{rpath} \ +-_SYSTYPE_SVR4 \ +-32" diff --git a/gcc/config/mips/iris6-o32-gas.h b/gcc/config/mips/iris6-o32-gas.h new file mode 100644 index 00000000000..fb540a922cf --- /dev/null +++ b/gcc/config/mips/iris6-o32-gas.h @@ -0,0 +1,19 @@ +/* Definitions of target machine for GNU compiler, for MIPS running IRIX 6 + (O32 ABI) using the GNU assembler. */ + +/* Enforce use of O32 linker, irrespective of SGI_ABI environment variable + and machine type (e.g., R8000 systems default to -64). Copied from + iris5gas.h, only adding -32. The default options -call_shared + -no_unresolved are only passed if not invoked with -r. */ +#undef LINK_SPEC +#define LINK_SPEC "\ +%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \ +%{bestGnum} %{shared} %{non_shared} \ +%{call_shared} %{no_archive} %{exact_version} \ +%{static: -non_shared} \ +%{!static: \ + %{!shared:%{!non_shared:%{!call_shared:%{!r: -call_shared -no_unresolved}}}}} \ +%{rpath} -init __do_global_ctors -fini __do_global_dtors \ +%{shared:-hidden_symbol __do_global_ctors,__do_global_ctors_1,__do_global_dtors} \ +-_SYSTYPE_SVR4 \ +-32" diff --git a/gcc/config/mips/iris6-o32.h b/gcc/config/mips/iris6-o32.h index c06f649194f..3ef2fe40d67 100644 --- a/gcc/config/mips/iris6-o32.h +++ b/gcc/config/mips/iris6-o32.h @@ -66,19 +66,3 @@ to -mips1 if no ISA is specified. */ #undef SUBTARGET_ASM_SPEC #define SUBTARGET_ASM_SPEC "-32 %{!mips*:-mips2}" - -/* Enforce use of O32 linker, irrespective of SGI_ABI environment variable - and machine type (e.g., R8000 systems default to -64). Copied from - iris5.h, only adding -32. The default options -call_shared -no_unresolved - are only passed if not invoked with -r. */ -#undef LINK_SPEC -#define LINK_SPEC "\ -%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} \ -%{bestGnum} %{shared} %{non_shared} \ -%{call_shared} %{no_archive} %{exact_version} \ -%{static: -non_shared} \ -%{!static: \ - %{!shared:%{!non_shared:%{!call_shared:%{!r: -call_shared -no_unresolved}}}}} \ -%{rpath} \ --_SYSTYPE_SVR4 \ --32" diff --git a/gcc/config/mips/t-iris5-gas b/gcc/config/mips/t-iris5-gas new file mode 100644 index 00000000000..5d70c3f1925 --- /dev/null +++ b/gcc/config/mips/t-iris5-gas @@ -0,0 +1,5 @@ +# For svr4 we build crtbegin.o and crtend.o which serve to add begin and +# end labels to the .ctors and .dtors section when we link using gcc. + +EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o +CRTSTUFF_T_CFLAGS=-g1