re PR target/10190 ([IRIX] building gcc 3.2.2 on irix 5.3 fails)
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Wed, 17 Sep 2003 17:40:05 +0000 (17:40 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 17 Sep 2003 17:40:05 +0000 (17:40 +0000)
* config/mips/iris5.h (TARGET_OS_CPP_BUILTINS): Define _LONGLONG.
Define _ABIO32.
Use it for _MIPS_SIM.
* config/mips/iris6-o32.h (TARGET_OS_CPP_BUILTINS): Removed.

* config/mips/iris6-o32-as.h (SUBTARGET_ASM_OPTIMIZING_SPEC):
Moved ...
* config/mips/iris5.h (SUBTARGET_ASM_OPTIMIZING_SPEC): ... here,
updating comment.
Fixes PR target/10190.

From-SVN: r71465

gcc/ChangeLog
gcc/config/mips/iris5.h
gcc/config/mips/iris6-o32-as.h
gcc/config/mips/iris6-o32.h

index 5e3578a..517a876 100644 (file)
@@ -1,3 +1,16 @@
+2003-09-17  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+       * config/mips/iris5.h (TARGET_OS_CPP_BUILTINS): Define _LONGLONG.
+       Define _ABIO32.
+       Use it for _MIPS_SIM.
+       * config/mips/iris6-o32.h (TARGET_OS_CPP_BUILTINS): Removed.
+
+       * config/mips/iris6-o32-as.h (SUBTARGET_ASM_OPTIMIZING_SPEC):
+       Moved ...
+       * config/mips/iris5.h (SUBTARGET_ASM_OPTIMIZING_SPEC): ... here,
+       updating comment.
+       Fixes PR target/10190.
+
 2003-09-17  Daniel Jacobowitz  <drow@mvista.com>
 
        * config/rs6000/sysv4.h (LIB_LINUX_SPEC): Make -pthread apply
index 5eac628..51f80dc 100644 (file)
@@ -56,16 +56,23 @@ Boston, MA 02111-1307, USA.  */
  (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 ("_MIPS_SIM=_MIPS_SIM_ABI32");   \
+       builtin_define ("_ABIO32=1");                   \
+       builtin_define ("_MIPS_SIM=_ABIO32");           \
        builtin_define ("_MIPS_SZPTR=32");              \
        builtin_assert ("system=unix");                 \
        builtin_assert ("system=svr4");                 \
@@ -96,6 +103,18 @@ Boston, MA 02111-1307, USA.  */
 #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} \
index 6aafc76..5cda89e 100644 (file)
@@ -1,17 +1,6 @@
 /* Definitions of target machine for GNU compiler, for MIPS running IRIX 6
    (O32 ABI) using the SGI assembler.  */
 
-/* Override mips.h default: the IRIX 6 O32 assembler warns about -O3:
-
-   as: Warning: -O3 is not supported for assembly compiles for ucode
-   compilers; changing to -O2.
-   
-   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}}"
-
 /* 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
index 20a6694..a525db1 100644 (file)
 #undef WINT_TYPE_SIZE
 #define WINT_TYPE_SIZE 32
 
-/* Copied from iris5.h, with _MIPS_SIM definition adapted to SGI cc usage
-   and -D_LONGLONG added as in iris6.h.  */
-#undef TARGET_OS_CPP_BUILTINS
-#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);
-
 /* Enforce use of O32 assembler, irrespective of SGI_ABI environment variable
    and machine type (e.g., R8000 systems default to -64).  Gas doesn't need
    this, but doesn't hurt either.  Need to pass -mips2 to gas which defaults