config.gcc (mips*-mti-linux*): Remove gnu_ld and gas assignments.
authorSteve Ellcey <sellcey@imgtec.com>
Thu, 6 Nov 2014 22:29:39 +0000 (22:29 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Thu, 6 Nov 2014 22:29:39 +0000 (22:29 +0000)
2014-11-06  Steve Ellcey  <sellcey@imgtec.com>

* config.gcc (mips*-mti-linux*): Remove gnu_ld and gas assignments.
Set default_mips_arch and default_mips_abi instead of tm_defines.
(mips*-*-linux*): Set default_mips_arch and default_mips_abi instead
of tm_defines.
(mips*-*-*): Check with_arch and with_abi.  Set tm_defines.
* config/mips/mips.h (STANDARD_STARTFILE_PREFIX_1): Set default
based on MIPS_ABI_DEFAULT.
(STANDARD_STARTFILE_PREFIX_2): Ditto.

From-SVN: r217203

gcc/ChangeLog
gcc/config.gcc
gcc/config/mips/mips.h

index 320e0d634e0333b268a97d1ac1bd335d60f1b4f5..3ed47a8c6f8833c9d163fe5fc06b4f1e4002e54a 100644 (file)
@@ -1,3 +1,14 @@
+2014-11-06  Steve Ellcey  <sellcey@imgtec.com>
+
+       * config.gcc (mips*-mti-linux*): Remove gnu_ld and gas assignments.
+       Set default_mips_arch and default_mips_abi instead of tm_defines.
+       (mips*-*-linux*): Set default_mips_arch and default_mips_abi instead
+       of tm_defines.
+       (mips*-*-*): Check with_arch and with_abi.  Set tm_defines.
+       * config/mips/mips.h (STANDARD_STARTFILE_PREFIX_1): Set default
+       based on MIPS_ABI_DEFAULT.
+       (STANDARD_STARTFILE_PREFIX_2): Ditto.
+
 2014-11-06  Joseph Myers  <joseph@codesourcery.com>
 
        * doc/invoke.texi (-std=c99, -std=c11): Don't refer to corner
index 10b0a6ec1280bf2d67feaf9eb9572c87b0aaf030..f1bfb6567467634917611a5b58c6490acc8bb052 100644 (file)
@@ -1952,30 +1952,30 @@ mips*-*-linux*)                         # Linux MIPS, either endian.
        extra_options="${extra_options} linux-android.opt"
        case ${target} in
                mipsisa32r2*)
-                       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
+                       default_mips_arch=mips32r2
                        ;;
                mipsisa32*)
-                       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
+                       default_mips_arch=mips32
                        ;;
                mips64el-st-linux-gnu)
-                       tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
+                       default_mips_abi=n32
                        tm_file="${tm_file} mips/st.h"
                        tmake_file="${tmake_file} mips/t-st"
                        enable_mips_multilibs="yes"
                        ;;
                mips64octeon*-*-linux*)
-                       tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
+                       default_mips_abi=n32
                        tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
                        target_cpu_default=MASK_SOFT_FLOAT_ABI
                        enable_mips_multilibs="yes"
                        ;;
                mipsisa64r2*-*-linux*)
-                       tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
-                       tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
+                       default_mips_abi=n32
+                       default_mips_arch=mips64r2
                        enable_mips_multilibs="yes"
                        ;;
                mips64*-*-linux* | mipsisa64*-*-linux*)
-                       tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
+                       default_mips_abi=n32
                        enable_mips_multilibs="yes"
                        ;;
        esac
@@ -4120,6 +4120,29 @@ case ${target} in
                                tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
                                ;;
                esac
+               if test x$with_arch != x; then
+                       default_mips_arch=$with_arch
+               fi
+               if test x$with_abi != x; then
+                       default_mips_abi=$with_abi
+               fi
+               case ${default_mips_arch} in
+                   mips1)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=1" ;;
+                   mips2)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=2" ;;
+                   mips3)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=3" ;;
+                   mips4)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=4" ;;
+                   mips32)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=32" ;;
+                   mips32r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=33" ;;
+                   mips64)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=64" ;;
+                   mips64r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=65" ;;
+               esac
+               case ${default_mips_abi} in
+                   32)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_32" ;;
+                   o64)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_O64" ;;
+                   n32)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_N32" ;;
+                   64)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_64" ;;
+                   eabi) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_EABI" ;;
+               esac
                tmake_file="mips/t-mips $tmake_file"
                ;;
 
index 39e6926bd0a01c167383a4cc5c152a18088aa7b8..dd67f11fe032e003c7d5feebb99018ca7aa100e1 100644 (file)
@@ -3006,3 +3006,13 @@ extern GTY(()) struct target_globals *mips16_globals;
    with arguments ARGS.  */
 #define PMODE_INSN(NAME, ARGS) \
   (Pmode == SImode ? NAME ## _si ARGS : NAME ## _di ARGS)
+
+/* If we are *not* using multilibs and the default ABI is not ABI_32 we
+   need to change these from /lib and /usr/lib.  */
+#if MIPS_ABI_DEFAULT == ABI_N32
+#define STANDARD_STARTFILE_PREFIX_1 "/lib32/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib32/"
+#elif MIPS_ABI_DEFAULT == ABI_64
+#define STANDARD_STARTFILE_PREFIX_1 "/lib64/"
+#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib64/"
+#endif