# HG changeset patch
# Parent d45c8c8a41993c685d1de58840fc675b4cb7b5c0
Cleanup Solaris linker version checks
@@ -277,8 +277,7 @@ fi
fi])
AC_DEFUN([gcc_AC_INITFINI_ARRAY],
-[AC_REQUIRE([gcc_SUN_LD_VERSION])dnl
-AC_ARG_ENABLE(initfini-array,
+[AC_ARG_ENABLE(initfini-array,
[ --enable-initfini-array use .init_array/.fini_array sections],
[], [
AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
@@ -556,43 +555,6 @@ if test $[$2] != yes; then
$8
fi])])
-dnl gcc_SUN_LD_VERSION
-dnl
-dnl Determines Sun linker version numbers, setting gcc_cv_sun_ld_vers to
-dnl the complete version number and gcc_cv_sun_ld_vers_{major, minor} to
-dnl the corresponding fields.
-dnl
-dnl ld and ld.so.1 are guaranteed to be updated in lockstep, so ld version
-dnl numbers can be used in ld.so.1 feature checks even if a different
-dnl linker is configured.
-dnl
-AC_DEFUN([gcc_SUN_LD_VERSION],
-[changequote(,)dnl
-if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
- 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
- #
- gcc_cv_sun_ld_ver=`/usr/ccs/bin/ld -V 2>&1`
- if echo "$gcc_cv_sun_ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
- gcc_cv_sun_ld_vers=`echo $gcc_cv_sun_ld_ver | sed -n \
- -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
- gcc_cv_sun_ld_vers_major=`expr "$gcc_cv_sun_ld_vers" : '\([0-9]*\)'`
- gcc_cv_sun_ld_vers_minor=`expr "$gcc_cv_sun_ld_vers" : '[0-9]*\.\([0-9]*\)'`
- fi
- ;;
- esac
-fi
-changequote([,])dnl
-])
-
dnl GCC_TARGET_TEMPLATE(KEY)
dnl ------------------------
dnl Define KEY as a valid configure key on the target machine.
@@ -2587,15 +2587,25 @@ if test $in_tree_ld != yes ; then
else
case "${target}" in
*-*-solaris2*)
- # See acinclude.m4 (gcc_SUN_LD_VERSION) for the version number
- # format.
+ # Solaris 2 ld -V output looks like this for a regular version:
#
- # Don't reuse gcc_gv_sun_ld_vers_* in case a linker other than
- # /usr/ccs/bin/ld has been configured.
+ # 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
+ #
+ # In Solaris 11.4, this was changed to
+ #
+ # ld: Solaris ELF Utilities: 11.4-1.3123
+ #
+ # ld and ld.so.1 are guaranteed to be updated in lockstep, so ld version
+ # numbers can be used in ld.so.1 feature checks even if a different
+ # linker is configured.
ld_ver=`$gcc_cv_ld -V 2>&1`
- if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
+ if echo "$ld_ver" | $EGREP 'Solaris Link Editors|Solaris ELF Utilities' > /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'`
+ -e 's,^.*: \(5\|1[0-9]\)\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\2,p'`
ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
fi