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:
- #
- # 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
- #
+ # Don't reuse gcc_gv_sun_ld_vers_* in case a linker other than
+ # /usr/ccs/bin/ld has been configured.
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 \
if test $set_have_as_tls = no; then
LIBS=
fi
+ # Even without TLS support on Solaris 8, explicitly link with libthread
+ # to guarantee that the alternate thread library is used.
+ case "$target" in
+ *-*-solaris2.8)
+ LIBS=-lthread
+ ;;
+ esac
# Always define LIB_TLS_SPEC, even without TLS support.
AC_DEFINE_UNQUOTED(LIB_TLS_SPEC, "$LIBS",
[Define to the library containing __tls_get_addr/___tls_get_addr.])