]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Support the use of binutils after o32 FPXX support was added
authorMatthew Fortune <matthew.fortune@imgtec.com>
Thu, 26 Feb 2015 10:40:06 +0000 (10:40 +0000)
committerMatthew Fortune <mpf@gcc.gnu.org>
Thu, 26 Feb 2015 10:40:06 +0000 (10:40 +0000)
Combined minimal backport of:
r213870 Fix mips16.S for soft-float
r213872 Pass -m(soft|hard|single|double)-float via ASM_SPEC
r217446 Implement o32 FPXX (minimal backport)
r217939 Update configure check for HAVE_AS_DOT_MODULE
r219867 Only pass floating-point options when necessary

gcc/
* config.in [!USED_FOR_TARGET] (HAVE_AS_DOT_MODULE): Undefine.
* config/mips/mips.h (FP_ASM_SPEC): New macro.
(ASM_SPEC): Use FP_ASM_SPEC.
* configure.ac (HAVE_AS_DOT_MODULE): Detect support for .module
and FPXX extensions.
* configure: Regenerate.

libgcc/
* config/mips/mips16.S: Do not build for soft-float.

From-SVN: r221000

gcc/ChangeLog
gcc/config.in
gcc/config/mips/mips.h
gcc/configure
gcc/configure.ac
libgcc/ChangeLog
libgcc/config/mips/mips16.S

index 0d8f66fff7c725f08064fc1330af3e75c5c12417..a85932addc73a2fa3db19b2395ed9f1a642ca146 100644 (file)
@@ -1,3 +1,14 @@
+2015-02-26  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       Backported from mainline: r213872, r217446, r217939, r219867
+
+       * config.in [!USED_FOR_TARGET] (HAVE_AS_DOT_MODULE): Undefine.
+       * config/mips/mips.h (FP_ASM_SPEC): New macro.
+       (ASM_SPEC): Use FP_ASM_SPEC.
+       * configure.ac (HAVE_AS_DOT_MODULE): Detect support for .module
+       and FPXX extensions.
+       * configure: Regenerate.
+
 2015-02-25  Jason Merrill  <jason@redhat.com>
 
        * common.opt (-flifetime-dse): New.
index 71cf0c93b913e7eef9859d39181670551ee54dfa..de4f09017f4e792c1fccfda0a9e72bf87beb23d0 100644 (file)
 #endif
 
 
+/* Define if the assembler understands .module. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_DOT_MODULE
+#endif
+
+
 /* Define if your assembler supports the -no-mul-bug-abort option. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION
index a786d4ce30393025be1ade7a5793088c60694cb0..ff88d9847f920342950874727bb41a1b1b6cd7b9 100644 (file)
@@ -1163,6 +1163,22 @@ struct mips_cpu_info {
 #define SUBTARGET_ASM_SPEC ""
 #endif
 
+/* FP_ASM_SPEC represents the floating-point options that must be passed
+   to the assembler when FPXX support exists.  Prior to that point the
+   assembler could accept the options but were not required for
+   correctness.  We only add the options when absolutely necessary
+   because passing -msoft-float to the assembler will cause it to reject
+   all hard-float instructions which may require some user code to be
+   updated.  */
+
+#ifdef HAVE_AS_DOT_MODULE
+#define FP_ASM_SPEC "\
+%{mhard-float} %{msoft-float} \
+%{msingle-float} %{mdouble-float}"
+#else
+#define FP_ASM_SPEC
+#endif
+
 #undef ASM_SPEC
 #define ASM_SPEC "\
 %{G*} %(endian_spec) %{mips1} %{mips2} %{mips3} %{mips4} \
@@ -1188,7 +1204,8 @@ struct mips_cpu_info {
 %{mfp32} %{mfp64} %{mnan=*} \
 %{mshared} %{mno-shared} \
 %{msym32} %{mno-sym32} \
-%{mtune=*} \
+%{mtune=*}" \
+FP_ASM_SPEC "\
 %(subtarget_asm_spec)"
 
 /* Extra switches sometimes passed to the linker.  */
index f48dd189e6acd9b6b0758e650839e911077a7f0d..fbfbdbb53ede38eb7b5ed5d2cfbdbd98303fcc1e 100755 (executable)
@@ -26138,6 +26138,38 @@ if test $gcc_cv_as_mips_gnu_attribute = yes; then
 
 $as_echo "#define HAVE_AS_GNU_ATTRIBUTE 1" >>confdefs.h
 
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .module support" >&5
+$as_echo_n "checking assembler for .module support... " >&6; }
+if test "${gcc_cv_as_mips_dot_module+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  gcc_cv_as_mips_dot_module=no
+  if test x$gcc_cv_as != x; then
+    $as_echo '.module mips2
+       .module fp=xx' > conftest.s
+    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -32 -o conftest.o conftest.s >&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+    then
+       gcc_cv_as_mips_dot_module=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_mips_dot_module" >&5
+$as_echo "$gcc_cv_as_mips_dot_module" >&6; }
+if test $gcc_cv_as_mips_dot_module = yes; then
+
+$as_echo "#define HAVE_AS_DOT_MODULE 1" >>confdefs.h
+
 fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .micromips support" >&5
index e54df10949ea306c497bb362b3172381d1c57ae2..792e9bb3d65f722b2b99c64997e5ef24017ffee4 100644 (file)
@@ -4251,6 +4251,13 @@ LCF0:
       [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
          [Define if your assembler supports .gnu_attribute.])])
 
+    gcc_GAS_CHECK_FEATURE([.module support],
+      gcc_cv_as_mips_dot_module,,[-32],
+      [.module mips2
+       .module fp=xx],,
+      [AC_DEFINE(HAVE_AS_DOT_MODULE, 1,
+         [Define if your assembler supports .module.])])
+
     gcc_GAS_CHECK_FEATURE([.micromips support],
       gcc_cv_as_micromips_support,,[--fatal-warnings],
       [.set micromips],,
index 91ca1a6b6ae7c8e05dc03a28b9a75e6f30f39711..db82cd4569f0f74f28f4cafd0014440b5b432a7f 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-26  Matthew Fortune  <matthew.fortune@imgtec.com>
+
+       Backported from mainline r213870
+
+       * config/mips/mips16.S: Do not build for soft-float.
+
 2015-02-17  Sandra Loosemore  <sandra@codesourcery.com>
 
        Backported from mainline
index 6a43a9839e78e20c43a4fb6a044d95b5cc896024..dde8939b4a3c13dbc03bd711b817229d3df22b38 100644 (file)
@@ -21,8 +21,12 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-#ifdef __mips_micromips
-  /* DO NOTHING */
+#if defined(__mips_micromips) || defined(__mips_soft_float)
+  /* Do nothing because this code is only needed when linking
+     against mips16 hard-float objects.  Neither micromips code
+     nor soft-float code can be linked against mips16 hard-float
+     objects so we do not need these routines when building libgcc
+     for those cases.  */
 #else
 
 /* This file contains mips16 floating point support functions.  These
@@ -749,4 +753,4 @@ CALL_STUB_RET (__mips16_call_stub_dc_10, 10, DC)
 #endif /* !__mips_single_float */
 
 #endif
-#endif /* __mips_micromips */
+#endif /* defined(__mips_micromips) || defined(__mips_soft_float) */