--- /usr/lib/tcl8.4/tcl.m4	2004-08-08 08:28:10.000000000 +0400
+++ tcl.m4	2004-09-03 18:37:31.000000000 +0400
@@ -1532,7 +1532,12 @@
 		arch=`isainfo`
 		if test "$arch" = "sparcv9 sparc" ; then
 			if test "$GCC" = "yes" ; then
-			    AC_MSG_WARN("64bit mode not supported with GCC on $system")
+				do64bit_ok=yes
+				CFLAGS="$CFLAGS -m64"
+				LDFLAGS="$LDFLAGS -m64"
+				SHLIB_CFLAGS="-fPIC"
+				SHLIB_LD_FLAGS=""
+				LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}/sparcv9"
 			else
 			    do64bit_ok=yes
 			    if test "$do64bitVIS" = "yes" ; then
@@ -1558,6 +1563,11 @@
 	    if test "$GCC" = "yes" ; then
 		SHLIB_LD="$CC -shared"
 		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+		if test "$do64bit" = "yes" ; then
+			SHLIB_LD="$SHLIB_LD -m64"
+			# for finding libgcc
+			CC_SEARCH_FLAGS="$CC_SEARCH_FLAGS,-R,/usr/local/lib/sparcv9"
+		fi	
 		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
 	    else
 		SHLIB_LD="/usr/ccs/bin/ld -G -z text"
