Commit 82563d35 by Richard Sandiford Committed by Richard Sandiford

configure.ac (mips*-*-*): Print an error if not using GAS.

	* configure.ac (mips*-*-*): Print an error if not using GAS.
	* configure: Regenerated.
	* doc/install.texi: Remove irix5 bullet from --with-gnu-as.  Remove
	comments about buggy MIPSpro assemblers.
	* config.gcc (mips-sgi-irix[56]*): Combine stanzas.  Include elfos.h
	before mips.h and iris.h after it.  Use t-iris and t-slibgcc-irix.
	Use iris5.h only for IRIX 5 configs.  Use iris6.h and t-iris6 for
	IRIX 6 configs.  Define IRIX_USING_GNU_LD if using GNU ld.
	* config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES)
	(DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC)
	(NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE)
	(TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h.
	(WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor
	of more general IRIX 6 definitions.
	(OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL)
	(HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions.
	(TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION)
	(LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC)
	(ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO)
	(PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER)
	(LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL)
	(TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS)
	(ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS)
	(SUBTARGET_EXTRA_SPECS): Delete definitions or undefs.
	(LINK_SPEC): Move most of definition to iris.h.
	(SUBTARGET_LINK_SPEC): New macro.
	(IRIX_STARTFILE_SPEC): Fold into...
	(STARTFILE_SPEC): ...here.
	(IRIX_ENDFILE_SPEC): Fold into...
	(ENDFILE_SPEC): ...here.
	* config/mips/iris6.h (TARGET_IRIX5): Remove override.
	(WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE)
	(DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP)
	(LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME)
	(ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h.
	(TARGET_OS_CPP_BUILTINS): Likewise.  Guard IRIX6-specific bits.
	(DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL)
	(SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO)
	(PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX)
	(ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE)
	(FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY)
	(POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC)
	(SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC)
	(BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*)
	(EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP)
	(DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME)
	(ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL)
	(ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs.
	(TARGET_IRIX6): Define to 1.
	(DRIVER_SELF_SPECS): Define.
	(DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS.
	(SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS.
	(SUBTARGET_LINK_SPEC): New macro.
	(IRIX_STARTFILE_SPEC): Fold into...
	(STARTFILE_SPEC): ...here.  Remove !mabi=* case.
	(SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros.
	(LIB_SPEC, LIBGCC_SPEC): Use them.
	(LIB_SPEC): Remove !mabi=* case.
	(IRIX_ENDFILE_SPEC): Fold into...
	(ENDFILE_SPEC): ...here.  Remove !mabi=* case.
	* config/mips/mips-protos.h (irix_output_external_libcall): Delete.
	* config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete.
	(TARGET_IRIX6): New macro.
	(ASM_ABI_DEFAULT_SPEC): Remove !ELF definition.
	(MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER)
	(LABEL_AFTER_LOC): Delete.
	* config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END)
	(TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions.
	(mips_build_builtin_va_list): Check TARGET_IRIX6.
	(override_options): Remove TARGET_SGI_O32_AS-related code.
	(irix_output_external_libcall): Make static.
	(mips_output_filename): Avoid use of SET_FILE_NUMBER and
	LABEL_AFTER_LOC.
	(mips_file_start): Tidy guard for ABI sections.  Remove use of
	ABICALLS_ASM_OP; use .abicalls instead.
	(mips_output_aligned_decl_common, mips_declare_object_name)
	(mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS.
	(mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting
	.globl foo .text directives.
	(irix_asm_named_section_1, irix_asm_named_section)
	(irix_section_align_entry, irix_section_align_htab)
	(irix_orig_asm_out_file, irix_section_align_entry_eq)
	(irix_section_align_entry_hash, irix_asm_output_align)
	(irix_file_start, irix_section_align_1, copy_file_data)
	(irix_file_end, irix_section_type_flags): Delete.
	* config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section.
	Use standard section syntax.  Remove protective "jr $31".
	(__gcc_fini): Likewise .gcc_fini.
	* config/mips/irix-crtn.asm: Adjust sections accordingly.
	* config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from
	iris5gas.h.
	* config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved
	from t-irix-gld.
	(EXTRA_MULTILIB_PARTS): Define.
	* config/mips/t-iris6: Remove bogus comment.
	(EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete.
	* config/mips/iris5gas.h, config/mips/iris5gld.h,
	config/mips/iris6gas.h, config/mips/iris6gld.h,
	config/mips/t-iris5-as, config/mips/t-iris5-gas
	config/mips/t-irix-gld: Delete.
	* config/mips/iris.h: New file.
	* config/mips/t-slibgcc-irix: Renamed from t-iris5-6.

From-SVN: r86309
parent c4cdb8e1
2004-08-20 Richard Sandiford <rsandifo@redhat.com>
* configure.ac (mips*-*-*): Print an error if not using GAS.
* configure: Regenerated.
* doc/install.texi: Remove irix5 bullet from --with-gnu-as. Remove
comments about buggy MIPSpro assemblers.
* config.gcc (mips-sgi-irix[56]*): Combine stanzas. Include elfos.h
before mips.h and iris.h after it. Use t-iris and t-slibgcc-irix.
Use iris5.h only for IRIX 5 configs. Use iris6.h and t-iris6 for
IRIX 6 configs. Define IRIX_USING_GNU_LD if using GNU ld.
* config/mips/iris5.h (TARGET_IRIX, SWITCHES_NEED_SPACES)
(DEFAULT_SIGNED_CHAR, WORD_SWITCH_TAKES_ARG, SUBTARGET_CC1_SPEC)
(NO_IMPLICIT_EXTERN_C, MIPS_DEFAULT_GVALUE)
(TARGET_ASM_EXTERNAL_LIBCALL): Move to iris.h.
(WCHAR_TYPE, WCHAR_TYPE_SIZE, TARGET_OS_CPP_BUILTINS): Delete in favor
of more general IRIX 6 definitions.
(OBJECT_FORMAT_ELF, ASM_OUTPUT_ASCII, ASM_WEAKEN_LABEL)
(HANDLE_SYSV_PRAGMA): Delete in favor of elfos.h definitions.
(TARGET_IRIX5, ABICALLS_ASM_OP, BSS_SECTION_ASM_OP, HAS_INIT_SECTION)
(LD_INIT_SWITCH, LD_FINI_SWITCH, SUBTARGET_ASM_OPTIMIZING_SPEC)
(ASM_FINAL_SPEC, DBX_DEBUGGING_INFO, MIPS_DEBUGGING_INFO)
(PREFERRED_DEBUGGING_TYPE, DWARF2_UNWIND_INFO, SET_FILE_NUMBER)
(LABEL_AFTER_LOC, DOLLARS_IN_IDENTIFIERS, NO_DOLLAR_IN_LABEL)
(TARGET_ASM_NAMED_SECTION, EXTRA_SECTION_FUNCTIONS)
(ASM_DECLARE_FUNCTION_SIZE, ASM_OUTPUT_WEAK_ALIAS)
(SUBTARGET_EXTRA_SPECS): Delete definitions or undefs.
(LINK_SPEC): Move most of definition to iris.h.
(SUBTARGET_LINK_SPEC): New macro.
(IRIX_STARTFILE_SPEC): Fold into...
(STARTFILE_SPEC): ...here.
(IRIX_ENDFILE_SPEC): Fold into...
(ENDFILE_SPEC): ...here.
* config/mips/iris6.h (TARGET_IRIX5): Remove override.
(WCHAR_TYPE, WCHAR_TYPE_SIZE, WINT_TYPE, WINT_TYPE_SIZE)
(DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE, SET_ASM_OP)
(LINK_ELIMINATE_DUPLICATE_LDIRECTORIES, ASM_DECLARE_OBJECT_NAME)
(ASM_FINISH_DECLARE_OBJECT, LOCAL_LABEL_PREFIX): Move to iris.h.
(TARGET_OS_CPP_BUILTINS): Likewise. Guard IRIX6-specific bits.
(DWARF2_UNWIND_INFO, DWARF2_GENERATE_TEXT_SECTION_LABEL)
(SUBTARGET_CPP_SPEC, DWARF2_DEBUGGING_INFO, MIPS_DEBUGGING_INFO)
(PREFERRED_DEBUGGING_TYPE, DWARF2_FRAME_INFO, MD_EXEC_PREFIX)
(ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE)
(FUNCTION_NAME_ALREADY_DECLARED, SUPPORTS_INIT_PRIORITY)
(POPSECTION_ASM_OP, SUBTARGET_ASM_SPEC, SUBTARGET_MIPS_AS_ASM_SPEC)
(SUBTARGET_ASM_DEBUGGING_SPEC, SUBTARGET_ASM_OPTIMIZING_SPEC)
(BSS_SECTION_ASM_OP*, READONLY_DATA_SECTION_ASM_OP*)
(EH_FRAME_SECTION_NAME, MUST_USE_SJLJ_EXCEPTIONS, CTORS_SECTION_ASM_OP)
(DTORS_SECTION_ASM_OP, TARGET_ASM_NAMED_SECTION, EH_FRAME_SECTION_NAME)
(ASM_OUTPUT_ALIGN, ASM_OUTPUT_FILENAME, ASM_OUTPUT_ALIGNED_LOCAL)
(ASM_OUTPUT_ALIGNED_BSS): Remove definitions or undefs.
(TARGET_IRIX6): Define to 1.
(DRIVER_SELF_SPECS): Define.
(DWARF2_FRAME_INFO): Define to 1 rather than !TARGET_SGI_O32_AS.
(SUBTARGET_CC1_SPEC): Remove in favor of DRIVER_SELF_SPECS.
(SUBTARGET_LINK_SPEC): New macro.
(IRIX_STARTFILE_SPEC): Fold into...
(STARTFILE_SPEC): ...here. Remove !mabi=* case.
(SUBTARGET_{,DONT_}WARN_UNUSED_SPEC): New macros.
(LIB_SPEC, LIBGCC_SPEC): Use them.
(LIB_SPEC): Remove !mabi=* case.
(IRIX_ENDFILE_SPEC): Fold into...
(ENDFILE_SPEC): ...here. Remove !mabi=* case.
* config/mips/mips-protos.h (irix_output_external_libcall): Delete.
* config/mips/mips.h (TARGET_IRIX5, TARGET_SGI_O32_AS): Delete.
(TARGET_IRIX6): New macro.
(ASM_ABI_DEFAULT_SPEC): Remove !ELF definition.
(MD_EXEC_PREFIX, MD_STARTFILE_PREFIX, SET_FILE_NUMBER)
(LABEL_AFTER_LOC): Delete.
* config/mips/mips.c (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END)
(TARGET_SECTION_TYPE_FLAGS): Remove TARGET_IRIX versions.
(mips_build_builtin_va_list): Check TARGET_IRIX6.
(override_options): Remove TARGET_SGI_O32_AS-related code.
(irix_output_external_libcall): Make static.
(mips_output_filename): Avoid use of SET_FILE_NUMBER and
LABEL_AFTER_LOC.
(mips_file_start): Tidy guard for ABI sections. Remove use of
ABICALLS_ASM_OP; use .abicalls instead.
(mips_output_aligned_decl_common, mips_declare_object_name)
(mips_finish_declare_object): Remove use of TARGET_SGI_O32_AS.
(mips_output_function_prologue): Set TREE_ASM_WRITTEN if emitting
.globl foo .text directives.
(irix_asm_named_section_1, irix_asm_named_section)
(irix_section_align_entry, irix_section_align_htab)
(irix_orig_asm_out_file, irix_section_align_entry_eq)
(irix_section_align_entry_hash, irix_asm_output_align)
(irix_file_start, irix_section_align_1, copy_file_data)
(irix_file_end, irix_section_type_flags): Delete.
* config/mips/irix-crti.asm (__gcc_init): Move to .gcc_init section.
Use standard section syntax. Remove protective "jr $31".
(__gcc_fini): Likewise .gcc_fini.
* config/mips/irix-crtn.asm: Adjust sections accordingly.
* config/mips/sdb.h (PUT_SDB_SIZE, PUT_SDB_TYPE): Moved from
iris5gas.h.
* config/mips/t-iris (irix-crti.o, irix-crtn.o): New rules, moved
from t-irix-gld.
(EXTRA_MULTILIB_PARTS): Define.
* config/mips/t-iris6: Remove bogus comment.
(EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS): Delete.
* config/mips/iris5gas.h, config/mips/iris5gld.h,
config/mips/iris6gas.h, config/mips/iris6gld.h,
config/mips/t-iris5-as, config/mips/t-iris5-gas
config/mips/t-irix-gld: Delete.
* config/mips/iris.h: New file.
* config/mips/t-slibgcc-irix: Renamed from t-iris5-6.
2004-08-20 Richard Earnshaw <rearnsha@arm.com>
* postreload.c (reload_cse_move2add): Allow any condjump, but check
......
......@@ -1274,68 +1274,28 @@ mcore-*-pe*)
tmake_file=mcore/t-mcore-pe
use_fixproto=yes
;;
mips-sgi-irix6*) # SGI System V.4., IRIX 6
tm_file="${tm_file} mips/iris5.h mips/iris6.h"
tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
if test x$gas = xyes
then
tm_file="${tm_file} mips/iris6gas.h"
fi
if test "x$gnu_ld" = xyes
then
tm_file="${tm_file} mips/iris6gld.h"
tmake_file="$tmake_file mips/t-irix-gld"
fi
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
use_fixproto=yes
;;
mips-sgi-irix5cross64) # Irix5 host, Irix 6 target, cross64
tm_file="${tm_file} mips/iris5.h mips/iris6.h mips/cross64.h"
tmake_file="mips/t-iris mips/t-cross64"
target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT"
tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
# See comment in mips/iris[56].h files.
use_collect2=yes
# if test x$enable_threads = xyes; then
# thread_file='irix'
# fi
use_fixproto=yes
;;
mips-sgi-irix5*) # SGI System V.4., IRIX 5
tm_file="${tm_file} mips/iris5.h"
if test x$gas = xyes
mips-sgi-irix[56]*)
tm_file="elfos.h ${tm_file} mips/iris.h"
tmake_file="mips/t-iris mips/t-slibgcc-irix"
target_cpu_default="MASK_GAS|MASK_ABICALLS"
case ${target} in
*-*-irix5*)
tm_file="${tm_file} mips/iris5.h"
;;
*-*-irix6*)
tm_file="${tm_file} mips/iris6.h"
tmake_file="${tmake_file} mips/t-iris6"
tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
;;
esac
if test "x$stabs" = xyes
then
tm_file="${tm_file} mips/sdb.h mips/iris5gas.h"
if test x$stabs = xyes
then
tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
fi
tmake_file=mips/t-iris5-gas
else
tmake_file=mips/t-iris5-as
tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
fi
if test "x$gnu_ld" = xyes
then
tm_file="${tm_file} mips/iris5gld.h"
tmake_file="$tmake_file mips/t-irix-gld"
fi
tmake_file="${tmake_file} mips/t-iris mips/t-iris5-6"
target_cpu_default="MASK_ABICALLS"
# mips-tfile doesn't work yet
# See comment in mips/iris5.h file.
if test x$gas = xno
then
use_collect2=yes
tm_defines="${tm_defines} IRIX_USING_GNU_LD"
fi
# if test x$enable_threads = xyes; then
# thread_file='irix'
......
/* Definitions of target machine for GNU compiler. Generic IRIX version.
Copyright (C) 1993, 1995, 1996, 1998, 2000,
2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* We are compiling for IRIX now. */
#undef TARGET_IRIX
#define TARGET_IRIX 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
specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
#define DWARF_OFFSET_SIZE PTR_SIZE
/* The size in bytes of the initial length field in a debug info
section. The DWARF 3 (draft) specification defines this to be
either 4 or 12 (with a 4-byte "escape" word when it's 12), but the
SGI/MIPS ABI predates this standard and defines it to be the same
as DWARF_OFFSET_SIZE. */
#define DWARF_INITIAL_LENGTH_SIZE DWARF_OFFSET_SIZE
/* MIPS assemblers don't have the usual .set foo,bar construct;
.set is used for assembler options instead. */
#undef SET_ASM_OP
#define ASM_OUTPUT_DEF(FILE, LABEL1, LABEL2) \
do \
{ \
fputc ('\t', FILE); \
assemble_name (FILE, LABEL1); \
fputs (" = ", FILE); \
assemble_name (FILE, LABEL2); \
fputc ('\n', FILE); \
} \
while (0)
/* The MIPSpro o32 linker warns about not linking .comment sections. */
#undef IDENT_ASM_OP
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX (TARGET_NEWABI ? "." : "$")
#undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
#undef ASM_FINISH_DECLARE_OBJECT
#define ASM_FINISH_DECLARE_OBJECT mips_finish_declare_object
/* Also do this for libcalls. */
#undef TARGET_ASM_EXTERNAL_LIBCALL
#define TARGET_ASM_EXTERNAL_LIBCALL irix_output_external_libcall
/* The linker needs a space after "-o". */
#define SWITCHES_NEED_SPACES "o"
/* Specify wchar_t types. */
#undef WCHAR_TYPE
#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
/* Same for wint_t. */
#undef WINT_TYPE
#define WINT_TYPE (Pmode == DImode ? "int" : "long int")
#undef WINT_TYPE_SIZE
#define WINT_TYPE_SIZE 32
/* Plain char is unsigned in the SGI compiler. */
#undef DEFAULT_SIGNED_CHAR
#define DEFAULT_SIGNED_CHAR 0
#define WORD_SWITCH_TAKES_ARG(STR) \
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|| strcmp (STR, "rpath") == 0)
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("host_mips"); \
builtin_define_std ("sgi"); \
builtin_define_std ("unix"); \
builtin_define_std ("SYSTYPE_SVR4"); \
builtin_define ("_MODERN_C"); \
builtin_define ("_SVR4_SOURCE"); \
builtin_define ("__DSO__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=svr4"); \
builtin_assert ("machine=sgi"); \
\
if (mips_abi == ABI_32) \
{ \
builtin_define ("_ABIO32=1"); \
builtin_define ("_MIPS_SIM=_ABIO32"); \
builtin_define ("_MIPS_SZINT=32"); \
builtin_define ("_MIPS_SZLONG=32"); \
builtin_define ("_MIPS_SZPTR=32"); \
} \
else if (mips_abi == ABI_64) \
{ \
builtin_define ("_ABI64=3"); \
builtin_define ("_MIPS_SIM=_ABI64"); \
builtin_define ("_MIPS_SZINT=32"); \
builtin_define ("_MIPS_SZLONG=64"); \
builtin_define ("_MIPS_SZPTR=64"); \
} \
else \
{ \
builtin_define ("_ABIN32=2"); \
builtin_define ("_MIPS_SIM=_ABIN32"); \
builtin_define ("_MIPS_SZINT=32"); \
builtin_define ("_MIPS_SZLONG=32"); \
builtin_define ("_MIPS_SZPTR=32"); \
} \
\
if (!ISA_MIPS1 && !ISA_MIPS2) \
builtin_define ("_COMPILER_VERSION=601"); \
\
if (!TARGET_FLOAT64) \
builtin_define ("_MIPS_FPSET=16"); \
else \
builtin_define ("_MIPS_FPSET=32"); \
\
/* We must always define _LONGLONG, even when -ansi is \
used, because IRIX 5 system header files require it. \
This is OK, because gcc never warns when long long \
is used in system header files. \
\
An alternative would be to support the SGI builtin \
type __long_long. */ \
builtin_define ("_LONGLONG"); \
\
/* IRIX 6.5.18 and above provide many ISO C99 \
features protected by the __c99 macro. \
libstdc++ v3 needs them as well. */ \
if (TARGET_IRIX6) \
if (flag_isoc99 || c_dialect_cxx ()) \
builtin_define ("__c99"); \
\
/* The GNU C++ standard library requires that \
__EXTENSIONS__ and _SGI_SOURCE be defined on at \
least IRIX 6.2 and probably all IRIX 6 prior to 6.5. \
We don't need this on IRIX 6.5 itself, but it \
shouldn't hurt other than the namespace pollution. */ \
if (!flag_iso || (TARGET_IRIX6 && c_dialect_cxx ())) \
{ \
builtin_define ("__EXTENSIONS__"); \
builtin_define ("_SGI_SOURCE"); \
} \
} \
while (0)
#undef SUBTARGET_CC1_SPEC
#define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP "\t.section\t.gcc_init,\"ax\",@progbits"
#undef FINI_SECTION_ASM_OP
#define FINI_SECTION_ASM_OP "\t.section\t.gcc_fini,\"ax\",@progbits"
#ifdef IRIX_USING_GNU_LD
#define IRIX_NO_UNRESOLVED ""
#else
#define IRIX_NO_UNRESOLVED "-no_unresolved"
#endif
/* Generic part of the LINK_SPEC. */
#undef LINK_SPEC
#define LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
%{bestGnum} %{shared} %{non_shared} \
%{call_shared} %{no_archive} %{exact_version} \
%{!shared: \
%{!non_shared: %{!call_shared:%{!r: -call_shared " IRIX_NO_UNRESOLVED "}}}} \
%{rpath} -init __gcc_init -fini __gcc_fini " IRIX_SUBTARGET_LINK_SPEC
/* A linker error can empirically be avoided by removing duplicate
library search directories. */
#define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1
/* Add -g to mips.h default to avoid confusing gas with local symbols
generated from stabs info. */
#undef NM_FLAGS
#define NM_FLAGS "-Bng"
/* The system header files are C++ aware. */
/* ??? Unfortunately, most but not all of the headers are C++ aware.
Specifically, curses.h is not, and as a consequence, defining this
used to prevent libg++ building. This is no longer the case so
define it again to prevent other problems, e.g. with getopt in
unistd.h. We still need some way to fix just those files that need
fixing. */
#define NO_IMPLICIT_EXTERN_C 1
/* -G is incompatible with -KPIC which is the default, so only allow objects
in the small data section if the user explicitly asks for it. */
#undef MIPS_DEFAULT_GVALUE
#define MIPS_DEFAULT_GVALUE 0
/* The native o32 IRIX linker does not support merging without a
special elspec(5) file. */
#ifndef IRIX_USING_GNU_LD
#undef HAVE_GAS_SHF_MERGE
#define HAVE_GAS_SHF_MERGE 0
#endif
......@@ -19,286 +19,27 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* We are compiling for IRIX now. */
#undef TARGET_IRIX
#define TARGET_IRIX 1
#ifdef IRIX_USING_GNU_LD
#define IRIX_SUBTARGET_LINK_SPEC "-melf32bsmip"
#else
#define IRIX_SUBTARGET_LINK_SPEC "-_SYSTYPE_SVR4"
#endif
/* Allow some special handling for IRIX 5. */
#undef TARGET_IRIX5
#define TARGET_IRIX5 1
#define ABICALLS_ASM_OP "\t.option pic2"
/* Dummy definition which allows EXTRA_SECTION_FUNCTIONS to be the same
for IRIX 5 and 6. */
#define BSS_SECTION_ASM_OP "\t.data"
/* ??? This is correct, but not very useful, because there is no file that
uses this macro. */
/* ??? The best way to handle global constructors under ELF is to use .init
and .fini sections. Unfortunately, there is apparently no way to get
the IRIX 5.x (x <= 2) assembler to create these sections. So we instead
use collect. The linker can create these sections via -init and -fini
options, but using this would require modifying how crtstuff works, and
I will leave that for another time (or someone else). */
#define OBJECT_FORMAT_ELF
#define HAS_INIT_SECTION
#define LD_INIT_SWITCH "-init"
#define LD_FINI_SWITCH "-fini"
/* The linker needs a space after "-o". */
#define SWITCHES_NEED_SPACES "o"
/* Specify wchar_t types. */
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE "int"
#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
/* Plain char is unsigned in the SGI compiler. */
#undef DEFAULT_SIGNED_CHAR
#define DEFAULT_SIGNED_CHAR 0
#define WORD_SWITCH_TAKES_ARG(STR) \
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|| !strcmp (STR, "rpath"))
/* We must pass -D_LONGLONG always, even when -ansi is used, because IRIX 5
system header files require it. This is OK, because gcc never warns
when long long is used in system header files. Alternatively, we can
add support for the SGI builtin type __long_long. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define_std ("host_mips"); \
builtin_define_std ("sgi"); \
builtin_define_std ("unix"); \
builtin_define_std ("SYSTYPE_SVR4"); \
builtin_define ("_LONGLONG"); \
builtin_define ("_MODERN_C"); \
builtin_define ("_SVR4_SOURCE"); \
builtin_define ("__DSO__"); \
builtin_define ("_ABIO32=1"); \
builtin_define ("_MIPS_SIM=_ABIO32"); \
builtin_define ("_MIPS_SZPTR=32"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=svr4"); \
builtin_assert ("machine=sgi"); \
\
if (!TARGET_FLOAT64) \
builtin_define ("_MIPS_FPSET=16"); \
else \
builtin_define ("_MIPS_FPSET=32"); \
\
if (!TARGET_INT64) \
builtin_define ("_MIPS_SZINT=32"); \
else \
builtin_define ("_MIPS_SZINT=64"); \
\
if (!TARGET_LONG64) \
builtin_define ("_MIPS_SZLONG=32"); \
else \
builtin_define ("_MIPS_SZLONG=64"); \
\
if (!flag_iso) \
{ \
builtin_define ("__EXTENSIONS__"); \
builtin_define ("_SGI_SOURCE"); \
} \
} while (0);
#undef SUBTARGET_CC1_SPEC
#define SUBTARGET_CC1_SPEC "%{static: -mno-abicalls}"
/* Override mips.h default: the IRIX 5 assembler warns about -O3:
as1: Warning: <file>.s, line 1: Binasm file dictates -pic: 2
uld:
No ucode object file linked -- please use -O2 or lower.
So avoid passing it in the first place. */
#undef SUBTARGET_ASM_OPTIMIZING_SPEC
#define SUBTARGET_ASM_OPTIMIZING_SPEC "\
%{noasmopt:-O0} \
%{!noasmopt:%{O|O1|O2|O3:-O2}}"
#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} \
-_SYSTYPE_SVR4"
/* We now support shared libraries. */
#define IRIX_STARTFILE_SPEC "\
#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}}}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%(irix_startfile_spec)"
%{!p:/usr/lib/nonshared/crt1.o%s}}} \
irix-crti.o%s crtbegin.o%s"
#undef LIB_SPEC
#define LIB_SPEC "%{!shared:%{p:-lprof1} %{pg:-lprof1} -lc}"
#define IRIX_ENDFILE_SPEC "%{!shared:crtn.o%s}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "%(irix_endfile_spec)"
/* We do not want to run mips-tfile! */
#undef ASM_FINAL_SPEC
/* The system header files are C++ aware. */
/* ??? Unfortunately, most but not all of the headers are C++ aware.
Specifically, curses.h is not, and as a consequence, defining this
used to prevent libg++ building. This is no longer the case so
define it again to prevent other problems, e.g. with getopt in
unistd.h. We still need some way to fix just those files that need
fixing. */
#define NO_IMPLICIT_EXTERN_C 1
/* We don't support debugging info for now. */
#undef DBX_DEBUGGING_INFO
#undef MIPS_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
/* Likewise, the assembler doesn't handle DWARF2 directives. */
#define DWARF2_UNWIND_INFO 0
#define ENDFILE_SPEC "crtend.o%s irix-crtn.o%s %{!shared:crtn.o%s}"
#undef MACHINE_TYPE
#define MACHINE_TYPE "SGI running IRIX 5.x"
/* Always use 1 for .file number. I [meissner@osf.org] wonder why
IRIX needs this. */
#undef SET_FILE_NUMBER
#define SET_FILE_NUMBER() num_source_filenames = 1
/* Put out a label after a .loc. I [meissner@osf.org] wonder why
IRIX needs this. */
#undef LABEL_AFTER_LOC
#define LABEL_AFTER_LOC(STREAM) fprintf (STREAM, "LM%d:\n", ++sym_lineno)
/* Dollar signs are OK in IRIX 5 but not in IRIX 3. */
#undef DOLLARS_IN_IDENTIFIERS
#undef NO_DOLLAR_IN_LABEL
/* -G is incompatible with -KPIC which is the default, so only allow objects
in the small data section if the user explicitly asks for it. */
#undef MIPS_DEFAULT_GVALUE
#define MIPS_DEFAULT_GVALUE 0
/* Switch into a generic section. */
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION irix_asm_named_section
/* Define functions to read the name and flags of the current section.
They are used by irix_asm_output_align. */
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
const char * \
current_section_name (void) \
{ \
switch (in_section) \
{ \
case no_section: return NULL; \
case in_unlikely_executed_text: \
case in_text: return ".text"; \
case in_data: return ".data"; \
case in_bss: return ".bss"; \
case in_readonly_data: \
if (mips_abi != ABI_32 && mips_abi != ABI_O64) \
return ".rodata"; \
else \
return ".rdata"; \
case in_named: \
return in_named_name; \
default: abort(); \
} \
} \
\
unsigned int \
current_section_flags (void) \
{ \
switch (in_section) \
{ \
case no_section: return 0; \
case in_unlikely_executed_text: \
case in_text: return SECTION_CODE; \
case in_data: return SECTION_WRITE; \
case in_bss: return SECTION_WRITE | SECTION_BSS; \
case in_readonly_data: return 0; \
case in_named: return get_named_section_flags (in_named_name); \
default: abort (); \
} \
}
/* Some assemblers have a bug that causes backslash escaped chars in .ascii
to be misassembled, so avoid it by using .byte instead. Write the original
string in a comment, partly to improve readability and partly for the sake
of scan-assembler-type tests. */
#undef ASM_OUTPUT_ASCII
#define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
do { \
const unsigned char *s_ = (const unsigned char *)(PTR); \
unsigned len_ = (LEN); \
unsigned i_; \
mips_output_ascii (FILE, (const char *) s_, len_, "\t# "); \
for (i_ = 0; i_ < len_; s_++, i_++) \
{ \
if ((i_ % 8) == 0) \
fputs ("\n\t.byte\t", (FILE)); \
fprintf ((FILE), "%s0x%x", (i_%8?",":""), *s_); \
} \
fputs ("\n", (FILE)); \
} while (0)
/* Also do this for libcalls. */
#undef TARGET_ASM_EXTERNAL_LIBCALL
#define TARGET_ASM_EXTERNAL_LIBCALL irix_output_external_libcall
/* This does for functions what ASM_DECLARE_OBJECT_NAME does for variables.
This is used indirectly by ASM_OUTPUT_EXTERNAL. */
#define ASM_DECLARE_FUNCTION_SIZE(STREAM, NAME, DECL) \
do { \
tree name_tree = get_identifier (NAME); \
TREE_ASM_WRITTEN (name_tree) = 1; \
} while (0)
/* This is how we tell the assembler that a symbol is weak. */
#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
do \
{ \
(*targetm.asm_out.globalize_label) (FILE, NAME); \
fputs ("\t.weakext\t", FILE); \
assemble_name (FILE, NAME); \
if (VALUE) \
{ \
fputc (' ', FILE); \
assemble_name (FILE, VALUE); \
} \
fputc ('\n', FILE); \
} \
while (0)
#define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0)
/* Handle #pragma weak and #pragma pack. */
#define HANDLE_SYSV_PRAGMA 1
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "irix_startfile_spec", IRIX_STARTFILE_SPEC }, \
{ "irix_endfile_spec", IRIX_ENDFILE_SPEC },
/* Definitions of target machine for GNU compiler. IRIX version 5 with gas.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Reenable debugging. */
#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 "%(irix_startfile_spec) crtbegin.o%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s %(irix_endfile_spec)"
/* Irix 5 does not have some strange restrictions that Irix 3 had. */
#undef SET_FILE_NUMBER
#define SET_FILE_NUMBER() ++num_source_filenames
#undef LABEL_AFTER_LOC
#define LABEL_AFTER_LOC(STREAM)
/* We need to use .esize and .etype instead of .size and .type to
avoid conflicting with ELF directives. These are only recognized
by gas, anyhow, not the native assembler. */
#undef PUT_SDB_SIZE
#define PUT_SDB_SIZE(a) \
do { \
fprintf (asm_out_file, "\t.esize\t" HOST_WIDE_INT_PRINT_DEC ";", \
(HOST_WIDE_INT) (a)); \
} while (0)
#undef PUT_SDB_TYPE
#define PUT_SDB_TYPE(a) \
do { \
fprintf (asm_out_file, "\t.etype\t0x%x;", (a)); \
} while (0)
/* Add -g to mips.h default to avoid confusing gas with local symbols
generated from stabs info. */
#undef NM_FLAGS
#define NM_FLAGS "-Bng"
/* Disable SHF_MERGE support. Even if gas supports it, the IRIX ld does not
without a special elspec(5) file.
FIXME: Only do this if not using GNU ld. */
#undef HAVE_GAS_SHF_MERGE
#define HAVE_GAS_SHF_MERGE 0
/* Definitions of target machine for GNU compiler. IRIX 5 with GNU ld.
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#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}}}} \
%{rpath} -init __gcc_init -fini __gcc_fini \
-melf32bsmip"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%(irix_startfile_spec) irix-crti.o%s crtbegin.o%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s irix-crtn.o%s %(irix_endfile_spec)"
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
/* Definitions of target machine for GNU compiler. IRIX 5 with GNU ld.
Copyright (C) 2003 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#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}}}} \
%{rpath} -init __do_global_ctors -fini __do_global_dtors \
-melf32bsmip"
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
/* Definitions for MIPS running IRIX 6 using GNU AS
Copyright (C) 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Definitions of target machine for GNU compiler. IRIX 6 with GNU as. */
/* Override iris6.h version to always use -init/-fini.
FIXME: integrate those use separate spec/define for this? */
#undef LINK_SPEC
#define LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
%{bestGnum} %{shared} %{non_shared} \
%{call_shared} %{no_archive} %{exact_version} %{w} \
%{!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 -woff 131 \
%{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
/* Disable SHF_MERGE support. Even if gas supports it, the IRIX 6 O32 ld
does not without a special elspec(5) file.
FIXME: Only do this if not using GNU ld. */
#if HAVE_GAS_SHF_MERGE
#undef HAVE_GAS_SHF_MERGE
#define HAVE_GAS_SHF_MERGE (mips_abi != ABI_32)
#endif /* HAVE_GAS_SHF_MERGE */
/* There's no need to perform collecting with GNU as. */
#undef COLLECT_PARSE_FLAG
/* Definitions of target machine for GNU compiler. Iris version 6 with
GNU ld.
Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
-L/usr/lib32} \
%{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
-L/usr/lib64} \
%{!mabi*: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
-L/usr/lib32} \
%{!shared: \
%{p:libprof1.a%s}%{pg:libprof1.a%s} -lc}"
/* Use the default libgcc spec. */
#undef LIBGCC_SPEC
/* ??? If no mabi=X option give, but a mipsX option is, then should depend
on the mipsX option. */
#undef LINK_SPEC
#define LINK_SPEC "\
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
%{bestGnum} %{shared} %{non_shared} \
%{call_shared} %{no_archive} %{exact_version} \
%{static: -non_shared} \
%{!static: \
%{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \
%{rpath} -init __gcc_init -fini __gcc_fini \
%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}%{!mabi*: -melf32bmipn32}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%(irix_startfile_spec) irix-crti.o%s crtbegin.o%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s irix-crtn.o%s %(irix_endfile_spec)"
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
......@@ -2,10 +2,31 @@
.set noreorder
.set nomacro
.section .init,0x1,0x6,4,4
jr $31
nop
/* The GNU and SGI linkers differ in their implementation of -init and -fini.
With the GNU linker, there can only be a single -init option, and the
linker simply sets DT_INIT to that value. gcc's initialization and
finalization code can go directly in .init, with the prologue and
epilogue of the main initialization routine being provided by external
object files (*crti.o and *crtn.o in this case).
The SGI linker instead accepts several -init options. It will set DT_INIT
to a linker-created function (placed in .init) that calls each of the -init
functions in turn. If there is any user code in .init, this linker-created
function will be placed after it. Note that such user code is not treated
specially; it will only be called if the -init options arrange for it to
be called.
In theory, the SGI model should allow the crti, crtn and intermediate code
to go in .init, just like it can with the GNU linker. However, doing this
seems to confuse the linker and triggers an internal error:
ld32: FATAL 2 : Internal: at ../../ld/mips_code.c mips_code_fixup()
text section overflow!
(seen with MIPSpro 7.30). We therefore put everything in a special
.gcc_init section instead. */
.section .gcc_init,"ax",@progbits
.globl __gcc_init
__gcc_init:
#if _MIPS_SIM == _ABIO32
......@@ -17,10 +38,7 @@ __gcc_init:
sd $28,8($sp)
#endif
.section .fini,0x1,0x6,4,4
jr $31
nop
.section .gcc_fini,"ax",@progbits
.globl __gcc_fini
__gcc_fini:
#if _MIPS_SIM == _ABIO32
......
......@@ -2,7 +2,7 @@
.set noreorder
.set nomacro
.section .init,0x1,0x6,4,4
.section .gcc_init,"ax",@progbits
#if _MIPS_SIM == _ABIO32
lw $31,0($sp)
jr $31
......@@ -14,7 +14,7 @@
daddiu $sp,$sp,16
#endif
.section .fini,0x1,0x6,4,4
.section .gcc_fini,"ax",@progbits
#if _MIPS_SIM == _ABIO32
lw $31,0($sp)
jr $31
......
......@@ -157,9 +157,6 @@ extern HOST_WIDE_INT mips_debugger_offset (rtx, HOST_WIDE_INT);
extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx);
extern int mips_output_external (FILE *, tree, const char *);
#if TARGET_IRIX
extern void irix_output_external_libcall (rtx);
#endif
extern void mips_output_filename (FILE *, const char *);
extern void mips_output_lineno (FILE *, int);
extern void mips_output_ascii (FILE *, const char *, size_t, const char *);
......
......@@ -365,8 +365,7 @@ extern const struct mips_cpu_info *mips_tune_info;
/* IRIX specific stuff. */
#define TARGET_IRIX 0
#define TARGET_IRIX5 0
#define TARGET_SGI_O32_AS (TARGET_IRIX && mips_abi == ABI_32 && !TARGET_GAS)
#define TARGET_IRIX6 0
/* Define preprocessor macros for the -march and -mtune options.
PREFIX is either _MIPS_ARCH or _MIPS_TUNE, INFO is the selected
......@@ -1060,12 +1059,6 @@ extern const struct mips_cpu_info *mips_tune_info;
#define ASM_ABI_DEFAULT_SPEC "-mabi=eabi"
#endif
/* Only ELF targets can switch the ABI. */
#ifndef OBJECT_FORMAT_ELF
#undef ASM_ABI_DEFAULT_SPEC
#define ASM_ABI_DEFAULT_SPEC ""
#endif
/* TARGET_ASM_SPEC is used to select either MIPS_AS_ASM_SPEC or
GAS_ASM_SPEC as the default, depending upon the value of
TARGET_DEFAULT. */
......@@ -1210,18 +1203,6 @@ extern const struct mips_cpu_info *mips_tune_info;
#ifndef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS
#endif
/* If defined, this macro is an additional prefix to try after
`STANDARD_EXEC_PREFIX'. */
#ifndef MD_EXEC_PREFIX
#define MD_EXEC_PREFIX "/usr/lib/cmplrs/cc/"
#endif
#ifndef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
#endif
#define DBX_DEBUGGING_INFO 1 /* generate stabs (OSF/rose) */
#define MIPS_DEBUGGING_INFO 1 /* MIPS specific debugging info */
......@@ -2858,11 +2839,6 @@ while (0)
/* How to tell the debugger about changes of source files. */
#ifndef SET_FILE_NUMBER
#define SET_FILE_NUMBER() ++num_source_filenames
#endif
#define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \
mips_output_filename (STREAM, NAME)
......@@ -2876,14 +2852,6 @@ do \
} \
while (0)
/* This is how to output a note the debugger telling it the line number
to which the following sequence of instructions corresponds.
Silicon graphics puts a label after each .loc. */
#ifndef LABEL_AFTER_LOC
#define LABEL_AFTER_LOC(STREAM)
#endif
#ifndef ASM_OUTPUT_SOURCE_LINE
#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE, COUNTER) \
mips_output_lineno (STREAM, LINE)
......
......@@ -87,3 +87,18 @@ do { \
} while (0)
#define PUT_SDB_EPILOGUE_END(NAME)
/* We need to use .esize and .etype instead of .size and .type to
avoid conflicting with ELF directives. */
#undef PUT_SDB_SIZE
#define PUT_SDB_SIZE(a) \
do { \
fprintf (asm_out_file, "\t.esize\t" HOST_WIDE_INT_PRINT_DEC ";", \
(HOST_WIDE_INT) (a)); \
} while (0)
#undef PUT_SDB_TYPE
#define PUT_SDB_TYPE(a) \
do { \
fprintf (asm_out_file, "\t.etype\t0x%x;", (a)); \
} while (0)
# Find all of the declarations from the header files
FIXPROTO_DEFINES= -D__EXTENSIONS__ -D_SGI_SOURCE -D_LANGUAGE_C_PLUS_PLUS
FIXPROTO_DEFINES = -D__EXTENSIONS__ -D_SGI_SOURCE -D_LANGUAGE_C_PLUS_PLUS
$(T)irix-crti.o: $(srcdir)/config/mips/irix-crti.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $@ -x assembler-with-cpp $<
$(T)irix-crtn.o: $(srcdir)/config/mips/irix-crtn.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $@ -x assembler-with-cpp $<
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o irix-crti.o irix-crtn.o
# Build a shared libgcc library.
SHLIB_EXT = .so
SHLIB_SOLINK = @shlib_base_name@.so
SHLIB_SONAME = @shlib_so_name@.so.1
SHLIB_NAME = @shlib_dir@@shlib_so_name@.so.1
SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-soname,$(SHLIB_SONAME) \
-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) -lc && \
rm -f $(SHLIB_SOLINK) && \
$(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
# ??? Irix 6.5 seems to eat the option fine (if we somehow remove the
# -hidden_symbol option, which is documented to be ignored in conjunction
# with -exports_file), but fails to actually hide any symbols.
# -Wl,-exports_file,$(SHLIB_MAP)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
$(INSTALL_DATA) $(SHLIB_NAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
# omit -g, gcc doesn't support the o32 mdebug debugging format and warns about
# every invocation with -g*
# add -save-temps to avoid comparison failure due to embedded temp file names
BOOT_CFLAGS = -O2 -save-temps
# omit -g1
LIBGCC2_DEBUG_CFLAGS =
# omit -g
FORCE_DEBUG_ADAFLAGS =
GNATLIBCFLAGS = -O2
# 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
# ??? If no mabi=X option given, but a mipsX option is, then should deal
# with that.
MULTILIB_OPTIONS=mabi=n32/mabi=32/mabi=64
MULTILIB_DIRNAMES=
MULTILIB_MATCHES=
......@@ -8,12 +6,6 @@ MULTILIB_OSDIRNAMES=. mabi=32 mabi=64
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
# 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
LIB2FUNCS_EXTRA = $(srcdir)/config/mips/_tilib.c
TPBIT = tp-bit.c
......
$(T)irix-crti.o: $(srcdir)/config/mips/irix-crti.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $@ -x assembler-with-cpp $<
$(T)irix-crtn.o: $(srcdir)/config/mips/irix-crtn.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $@ -x assembler-with-cpp $<
EXTRA_MULTILIB_PARTS += irix-crti.o irix-crtn.o
# Build a shared libgcc library.
SHLIB_EXT = .so
SHLIB_SOLINK = @shlib_base_name@.so
SHLIB_SOVERSION = 1
SHLIB_SONAME = @shlib_so_name@.so.$(SHLIB_SOVERSION)
SHLIB_NAME = @shlib_dir@@shlib_so_name@.so.$(SHLIB_SOVERSION)
SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
SHLIB_LC = -lc
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
-Wl,-soname,$(SHLIB_SONAME) \
-o $(SHLIB_NAME) @multilib_flags@ $(SHLIB_OBJS) $(SHLIB_LC) && \
rm -f $(SHLIB_SOLINK) && \
$(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
$$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
$(INSTALL_DATA) $(SHLIB_NAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
$(LN_S) $(SHLIB_SONAME) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver
......@@ -2674,6 +2674,15 @@ foo: nop
else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS"
fi])
if test x$gas_flag = xyes \
|| test x"$host" != x"$build" \
|| test ! -x "$gcc_cv_as" \
|| "$gcc_cv_as" -v < /dev/null 2>&1 | grep GNU > /dev/null; then
:
else
echo "*** This configuration requires the GNU assembler" >&2
exit 1
fi
;;
esac
# ??? Not all targets support dwarf2 debug_line, even within a version
......
......@@ -788,14 +788,13 @@ whether you use the GNU assembler. On any other system,
@item @samp{m68k-hp-hpux}
@item @samp{m68000-hp-hpux}
@item @samp{m68000-att-sysv}
@item @samp{mips-@var{any}}
@item @samp{sparc-sun-solaris2.@var{any}}
@item @samp{sparc64-@var{any}-solaris2.@var{any}}
@end itemize
On the systems listed above (except for the HP-PA, the SPARC, for ISC on
the 386, and for @samp{mips-sgi-irix5.*}), if you use the GNU assembler,
you should also use the GNU linker (and specify @option{--with-gnu-ld}).
the 386, if you use the GNU assembler, you should also use the GNU linker
(and specify @option{--with-gnu-ld}).
@item @anchor{with-as}--with-as=@var{pathname}
Specify that the
......@@ -3199,9 +3198,9 @@ to increase its table size for switch statements with the
optimization option, you also need to use @option{-Olimit 3000}.
To enable debugging under IRIX 5, you must use GNU binutils 2.15 or
later, and use the @option{--with-gnu-as} and @option{--with-gnu-ld}
@command{configure} options when configuring GCC@. You need to use GNU
@command{ar} and @command{nm}, also distributed with GNU binutils.
later, and use the @option{--with-gnu-ld} @command{configure} option
when configuring GCC@. You need to use GNU @command{ar} and @command{nm},
also distributed with GNU binutils.
@html
<hr />
......@@ -3231,12 +3230,7 @@ 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@. SGI's MIPSpro 7.2 assembler may misassemble
parts of the compiler, causing bootstrap failures. MIPSpro 7.3 is
known to work. MIPSpro C 7.4 may cause bootstrap failures, too, due
to a bug when inlining @code{memcmp}. Either add @code{-U__INLINE_INTRINSICS}
to the @env{CC} environment variable as a workaround or upgrade to
MIPSpro C 7.4.1m.
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 @samp{mips3}
......@@ -3259,6 +3253,10 @@ test.o: ELF N32 MSB mips-4 @dots{}
instead, you should set the environment variable @env{CC} to @samp{cc
-n32 -mips3} or @samp{gcc -mips3} respectively before configuring GCC@.
MIPSpro C 7.4 may cause bootstrap failures, due to a bug when inlining
@code{memcmp}. Either add @code{-U__INLINE_INTRINSICS} to the @env{CC}
environment variable as a workaround or upgrade to MIPSpro C 7.4.1m.
GCC on IRIX 6 is usually built to support the N32, O32 and N64 ABIs. If
you build GCC on a system that doesn't have the N64 libraries installed
or cannot run 64-bit binaries,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment