OSDN Git Service

* configure.ac: Determine Sun ld version numbers.
authorro@138bc75d-0d04-0410-961f-82ee72b054a4 <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Apr 2010 17:32:54 +0000 (17:32 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:55:06 +0000 (09:55 +0900)
(comdat_group): Restrict GNU ld version checks to gld.
(comdat_group, *-*-solaris2.1[1-9]*): Enable for Sun ld > 1.1688.
(enable_comdat): Support --enable-comdat.
* configure: Regenerate.
* doc/install.texi (Configuration): Document --enable-comdat.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158172 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/configure
gcc/configure.ac
gcc/doc/install.texi

index 6ee7cb6..a822b36 100644 (file)
@@ -1,5 +1,14 @@
 2010-04-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 2010-04-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
+       * configure.ac: Determine Sun ld version numbers.
+       (comdat_group): Restrict GNU ld version checks to gld.
+       (comdat_group, *-*-solaris2.1[1-9]*): Enable for Sun ld > 1.1688.
+       (enable_comdat): Support --enable-comdat.
+       * configure: Regenerate.
+       * doc/install.texi (Configuration): Document --enable-comdat.
+
+2010-04-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
        * config/sparc/sol2-gld.h: Remove SPARC reference.
        Rename ...
        * config/sol2-gld.h: ... here.
        * config/sparc/sol2-gld.h: Remove SPARC reference.
        Rename ...
        * config/sol2-gld.h: ... here.
index c3ff39c..888fc94 100755 (executable)
@@ -900,6 +900,7 @@ with_pic
 enable_fast_install
 enable_libtool_lock
 with_plugin_ld
 enable_fast_install
 enable_libtool_lock
 with_plugin_ld
+enable_comdat
 enable_gnu_unique_object
 enable_linker_build_id
 with_long_double_128
 enable_gnu_unique_object
 enable_linker_build_id
 with_long_double_128
@@ -1602,6 +1603,7 @@ Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-comdat         enable COMDAT group support
   --enable-gnu-unique-object   enable the use of the @gnu_unique_object ELF extension on
                                glibc systems
   --enable-linker-build-id
   --enable-gnu-unique-object   enable the use of the @gnu_unique_object ELF extension on
                                glibc systems
   --enable-linker-build-id
@@ -17037,7 +17039,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17040 "configure"
+#line 17042 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17143,7 +17145,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17146 "configure"
+#line 17148 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -21210,6 +21212,27 @@ if test $in_tree_ld != yes ; then
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+  else
+    case "${target}" in
+      *-*-solaris2*)
+       #
+       # Solaris 2 ld -V output looks like this for a regular version:
+       #
+       # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1699
+       #
+       # but test versions add stuff at the end:
+       #
+       # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10
+       #
+       ld_ver=`$gcc_cv_ld -V 2>&1`
+       if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
+         ld_vers=`echo $ld_ver | sed -n \
+           -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
+         ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
+         ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
+       fi
+       ;;
+    esac
   fi
 fi
 
   fi
 fi
 
@@ -21808,7 +21831,7 @@ elif test $in_tree_ld = yes ; then
      && test $in_tree_ld_is_elf = yes; then
      comdat_group=yes
   fi
      && test $in_tree_ld_is_elf = yes; then
      comdat_group=yes
   fi
-elif test x"$ld_vers" != x; then
+elif echo "$ld_ver" | grep GNU > /dev/null; then
   comdat_group=yes
   if test 0"$ld_date" -lt 20050308; then
     if test -n "$ld_date"; then
   comdat_group=yes
   if test 0"$ld_date" -lt 20050308; then
     if test -n "$ld_date"; then
@@ -21821,9 +21844,32 @@ elif test x"$ld_vers" != x; then
     fi
   fi
 else
     fi
   fi
 else
-  # assume linkers other than GNU ld don't support COMDAT group
-  comdat_group=no
+  case "${target}" in
+    *-*-solaris2.1[1-9]*)
+      # Sun ld has COMDAT group support since Solaris 9, but it doesn't
+      # interoperate with GNU as until Solaris 11 build 130, i.e. ld
+      # version 1.688.
+      #
+      # FIXME: Maybe need to refine later when COMDAT group support with
+      # Sun as is implemented.
+      if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 1688; then
+        comdat_group=yes
+      else
+        comdat_group=no
+      fi
+      ;;
+    *)
+      # Assume linkers other than GNU ld don't support COMDAT group.
+      comdat_group=no
+      ;;
+  esac
 fi
 fi
+# Allow overriding the automatic COMDAT group tests above.
+# Check whether --enable-comdat was given.
+if test "${enable_comdat+set}" = set; then :
+  enableval=$enable_comdat; comdat_group="$enable_comdat"
+fi
+
 if test $comdat_group = no; then
   gcc_cv_as_comdat_group=no
   gcc_cv_as_comdat_group_percent=no
 if test $comdat_group = no; then
   gcc_cv_as_comdat_group=no
   gcc_cv_as_comdat_group_percent=no
index ea1a040..abf03c5 100644 (file)
@@ -2142,6 +2142,27 @@ if test $in_tree_ld != yes ; then
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
     ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
     ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
     ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+  else
+    case "${target}" in
+      *-*-solaris2*)
+       #
+       # Solaris 2 ld -V output looks like this for a regular version:
+       #
+       # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1699
+       #
+       # but test versions add stuff at the end:
+       #
+       # ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1701:onnv-ab196087-6931056-03/25/10
+       #
+       ld_ver=`$gcc_cv_ld -V 2>&1`
+       if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
+         ld_vers=`echo $ld_ver | sed -n \
+           -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
+         ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
+         ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
+       fi
+       ;;
+    esac
   fi
 fi
 changequote([,])dnl
   fi
 fi
 changequote([,])dnl
@@ -2462,7 +2483,7 @@ elif test $in_tree_ld = yes ; then
      && test $in_tree_ld_is_elf = yes; then
      comdat_group=yes
   fi
      && test $in_tree_ld_is_elf = yes; then
      comdat_group=yes
   fi
-elif test x"$ld_vers" != x; then
+elif echo "$ld_ver" | grep GNU > /dev/null; then
   comdat_group=yes
   if test 0"$ld_date" -lt 20050308; then
     if test -n "$ld_date"; then
   comdat_group=yes
   if test 0"$ld_date" -lt 20050308; then
     if test -n "$ld_date"; then
@@ -2475,9 +2496,32 @@ elif test x"$ld_vers" != x; then
     fi
   fi
 else
     fi
   fi
 else
-  # assume linkers other than GNU ld don't support COMDAT group
-  comdat_group=no
+changequote(,)dnl
+  case "${target}" in
+    *-*-solaris2.1[1-9]*)
+      # Sun ld has COMDAT group support since Solaris 9, but it doesn't
+      # interoperate with GNU as until Solaris 11 build 130, i.e. ld
+      # version 1.688.
+      #
+      # FIXME: Maybe need to refine later when COMDAT group support with
+      # Sun as is implemented.
+      if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 1688; then
+        comdat_group=yes
+      else
+        comdat_group=no
+      fi
+      ;;
+    *)
+      # Assume linkers other than GNU ld don't support COMDAT group.
+      comdat_group=no
+      ;;
+  esac
+changequote([,])dnl
 fi
 fi
+# Allow overriding the automatic COMDAT group tests above.
+AC_ARG_ENABLE(comdat,
+  [AS_HELP_STRING([--enable-comdat], [enable COMDAT group support])],
+  [comdat_group="$enable_comdat"])
 if test $comdat_group = no; then
   gcc_cv_as_comdat_group=no
   gcc_cv_as_comdat_group_percent=no
 if test $comdat_group = no; then
   gcc_cv_as_comdat_group=no
   gcc_cv_as_comdat_group_percent=no
index 00dd787..c2468dc 100644 (file)
@@ -1233,6 +1233,10 @@ This is the default for the m32r platform.
 Specify that the user visible @command{cpp} program should be installed
 in @file{@var{prefix}/@var{dirname}/cpp}, in addition to @var{bindir}.
 
 Specify that the user visible @command{cpp} program should be installed
 in @file{@var{prefix}/@var{dirname}/cpp}, in addition to @var{bindir}.
 
+@item --enable-comdat
+Enable COMDAT group support.  This is primarily used to override the
+automatically detected value.
+
 @item --enable-initfini-array
 Force the use of sections @code{.init_array} and @code{.fini_array}
 (instead of @code{.init} and @code{.fini}) for constructors and
 @item --enable-initfini-array
 Force the use of sections @code{.init_array} and @code{.fini_array}
 (instead of @code{.init} and @code{.fini}) for constructors and