Richard,

Here is a new copy of my mips-mti-elf patch.  I removed
SYSROOT_SUFFIX_SPEC since that was unneeded as you said and changed 
DRIVER_SELF_SPECS to set the ABI to n32 by default on mips64 targets
like mips-sde-elf does.  I also updated t-mti-elf to add mips16 and
mabi=64 targets and verified that they worked.  That also entailed
adding some MULTILIB_EXCEPTIONS entries to t-mti-elf.

Here is a new patch for the gcc directory changes (config.gcc,
config/mips/mti-elf.h, config/mips/t-mti-elf).  I have not included the
top-level changes and the testsuite change that were in my initial
submission since those haven't changed since then.

Once I have gotten this approved and checked in I will go back and
revisit mips-mti-linux-gnu and see if I can implement your ideas for
that target (making n32 the default ABI for mips64 targets and using the
IRIX style sysroot directory setup.

Steve Ellcey
sell...@mips.com


2012-09-19  Steve Ellcey  <sell...@mips.com>

        * config.gcc (mips*-mti-elf*): New target.
        * config/mips/mti-elf.h: New file.
        * config/mips/t-mti-elf: New file.


diff --git a/gcc/config.gcc b/gcc/config.gcc
index ba366b3..9f5e170 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1741,6 +1741,11 @@ mips*-*-linux*)                          # Linux MIPS, 
either endian.
         esac
        test x$with_llsc != x || with_llsc=yes
        ;;
+mips*-mti-elf*)
+       tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h 
mips/mti-elf.h"
+       tmake_file="mips/t-mti-elf"
+       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
+       ;;
 mips*-sde-elf*)
        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h"
        tmake_file="mips/t-sde"
diff --git a/gcc/config/mips/mti-elf.h b/gcc/config/mips/mti-elf.h
new file mode 100644
index 0000000..f6b38a5
--- /dev/null
+++ b/gcc/config/mips/mti-elf.h
@@ -0,0 +1,43 @@
+/* Target macros for mips*-mti-elf targets.
+   Copyright (C) 2012
+   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 3, 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 COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#undef DRIVER_SELF_SPECS
+#define DRIVER_SELF_SPECS                                              \
+  /* Make sure a -mips option is present.  This helps us to pick       \
+     the right multilib, and also makes the later specs easier         \
+     to write.  */                                                     \
+  MIPS_ISA_LEVEL_SPEC,                                                 \
+                                                                       \
+  /* Infer the default float setting from -march.  */                  \
+  MIPS_ARCH_FLOAT_SPEC,                                                        
\
+                                                                       \
+  /* Infer the -msynci setting from -march if not explicitly set.  */  \
+  MIPS_ISA_SYNCI_SPEC,                                                 \
+                                                                       \
+  /* If no ABI option is specified, infer one from the ISA level       \
+     or -mgp setting.  */                                              \
+  "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}",   \
+                                                                       \
+  /* Make sure that an endian option is always present.  This makes    \
+     things like LINK_SPEC easier to write.  */                                
\
+  "%{!EB:%{!EL:%(endian_spec)}}",                                      \
+                                                                       \
+  /* Configuration-independent MIPS rules.  */                         \
+  BASE_DRIVER_SELF_SPECS
diff --git a/gcc/config/mips/t-mti-elf b/gcc/config/mips/t-mti-elf
new file mode 100644
index 0000000..d1d975a
--- /dev/null
+++ b/gcc/config/mips/t-mti-elf
@@ -0,0 +1,35 @@
+# Copyright (C) 2012 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 3, 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 COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+MULTILIB_OPTIONS = mips32/mips64/mips64r2 mips16 mabi=64 EL msoft-float
+MULTILIB_DIRNAMES = mips32 mips64 mips64r2 mips16 64 el sof
+MULTILIB_MATCHES = EL=mel EB=meb
+
+# We do not want to build mips16 versions of mips64* architectures.
+MULTILIB_EXCEPTIONS += *mips64*/*mips16*
+
+# 64 bit ABI is not supported on mips32 architecture.
+MULTILIB_EXCEPTIONS += *mips32*/*mabi=64*
+
+# The 64 bit ABI is not supported on the mips32r2 bit architecture.
+# Because mips32r2 is the default the exception list is a little messy.
+# Basically we are saying any list that doesn't specify mips32, mips64,
+# or mips64r2 but does specify mabi=64 is not allowed because that
+# would be defaulting to the mips32r2 architecture.
+MULTILIB_EXCEPTIONS += mabi=64*
+MULTILIB_EXCEPTIONS += mips16/mabi=64*


Reply via email to