configure.ac: Check for .gnu_attribute on MIPS.
authorJoseph Myers <joseph@codesourcery.com>
Sat, 30 Jun 2007 22:01:30 +0000 (23:01 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sat, 30 Jun 2007 22:01:30 +0000 (23:01 +0100)
* configure.ac: Check for .gnu_attribute on MIPS.
* configure, config.in: Regenerate.
* config/mips/mips.c (mips_file_start): If supported, output
attribute for floating-point ABI.

From-SVN: r126157

gcc/ChangeLog
gcc/config.in
gcc/config/mips/mips.c
gcc/configure
gcc/configure.ac

index dc35a49316b7d81d65fc624f0c23e03fd27fc591..c8f71eeb1a64516bcb8fb01d1da3965f14c23d00 100644 (file)
@@ -1,3 +1,10 @@
+2007-06-30  Joseph Myers  <joseph@codesourcery.com>
+
+       * configure.ac: Check for .gnu_attribute on MIPS.
+       * configure, config.in: Regenerate.
+       * config/mips/mips.c (mips_file_start): If supported, output
+       attribute for floating-point ABI.
+
 2007-06-30  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/32433
index 22f9685887da364016cf8fc3465b6421369319a0..e5faa7a51889dd267d3025ef866bad01c75d01b5 100644 (file)
 #endif
 
 
+/* Define if your assembler supports .gnu_attribute. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_GNU_ATTRIBUTE
+#endif
+
+
 /* Define true if the assembler supports '.long foo@GOTOFF'. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_GOTOFF_IN_DATA
index a132f0ff4c9e7cb974d6e22fd093cf99fb93b17c..a675499596ceeddba1ac84dcd2a76f5be7673f06 100644 (file)
@@ -6010,6 +6010,11 @@ mips_file_start (void)
 
   if (!TARGET_IRIX)
     {
+#ifdef HAVE_AS_GNU_ATTRIBUTE
+      fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n",
+              TARGET_HARD_FLOAT_ABI ? (TARGET_DOUBLE_FLOAT ? 1 : 2) : 3);
+#endif
+
       /* Generate a special section to describe the ABI switches used to
         produce the resultant binary.  This used to be done by the assembler
         setting bits in the ELF header's flags field, but we have run out of
index a5f9fe396d16a5893388a04cd3c50a7183bb7ecb..68f8ed6e425c1a4ddf83fd0834675aef789ce880 100755 (executable)
@@ -15832,6 +15832,43 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_AS_NO_SHARED 1
 _ACEOF
 
+fi
+
+    echo "$as_me:$LINENO: checking assembler for .gnu_attribute support" >&5
+echo $ECHO_N "checking assembler for .gnu_attribute support... $ECHO_C" >&6
+if test "${gcc_cv_as_mips_gnu_attribute+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  gcc_cv_as_mips_gnu_attribute=no
+    if test $in_tree_gas = yes; then
+    if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 18 \) \* 1000 + 0`
+  then gcc_cv_as_mips_gnu_attribute=yes
+fi
+  elif test x$gcc_cv_as != x; then
+    echo '.gnu_attribute 4,1' > conftest.s
+    if { ac_try='$gcc_cv_as  -o conftest.o conftest.s >&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+    then
+       gcc_cv_as_mips_gnu_attribute=yes
+    else
+      echo "configure: failed program was" >&5
+      cat conftest.s >&5
+    fi
+    rm -f conftest.o conftest.s
+  fi
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_as_mips_gnu_attribute" >&5
+echo "${ECHO_T}$gcc_cv_as_mips_gnu_attribute" >&6
+if test $gcc_cv_as_mips_gnu_attribute = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AS_GNU_ATTRIBUTE 1
+_ACEOF
+
 fi
     ;;
 esac
index 7a29b916637b05c65835ea8632ac48f6a01f4d76..3e0f53adbec0821163c0afe2634d2d5c089dda0e 100644 (file)
@@ -2943,6 +2943,12 @@ LCF0:
       gcc_cv_as_mips_no_shared, [2,16,0], [-mno-shared], [nop],,
       [AC_DEFINE(HAVE_AS_NO_SHARED, 1,
                 [Define if the assembler understands -mno-shared.])])
+
+    gcc_GAS_CHECK_FEATURE([.gnu_attribute support],
+      gcc_cv_as_mips_gnu_attribute, [2,18,0],,
+      [.gnu_attribute 4,1],,
+      [AC_DEFINE(HAVE_AS_GNU_ATTRIBUTE, 1,
+         [Define if your assembler supports .gnu_attribute.])])
     ;;
 esac