[csw-devel] SF.net SVN: gar:[2888] csw/mgar/pkg/tcl85/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Thu Jan 22 23:01:46 CET 2009


Revision: 2888
          http://gar.svn.sourceforge.net/gar/?rev=2888&view=rev
Author:   dmichelsen
Date:     2009-01-22 22:01:46 +0000 (Thu, 22 Jan 2009)

Log Message:
-----------
tcl85: Add patches for Solaris x86, needs more work

Modified Paths:
--------------
    csw/mgar/pkg/tcl85/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/tcl85/trunk/files/sunmath-updated.diff
    csw/mgar/pkg/tcl85/trunk/files/sunmath.diff

Modified: csw/mgar/pkg/tcl85/trunk/Makefile
===================================================================
--- csw/mgar/pkg/tcl85/trunk/Makefile	2009-01-22 21:59:25 UTC (rev 2887)
+++ csw/mgar/pkg/tcl85/trunk/Makefile	2009-01-22 22:01:46 UTC (rev 2888)
@@ -13,6 +13,12 @@
 DISTFILES  = $(DISTNAME)-src.tar.gz
 DISTFILES += $(call admfiles,CSWtcl85,)
 
+# From https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1839067&group_id=10894
+# for Solaris x86:
+#PATCHFILES = sunmath-updated.diff
+#PATCHFILES = sunmath.diff
+# Both patches seem to be for HEAD instead of 8.5.6, to postpone for now
+
 SPKG_SOURCEURL = http://www.tcl.tk/
 
 # We define upstream file regex so we can be notifed of new upstream software release

Added: csw/mgar/pkg/tcl85/trunk/files/sunmath-updated.diff
===================================================================
--- csw/mgar/pkg/tcl85/trunk/files/sunmath-updated.diff	                        (rev 0)
+++ csw/mgar/pkg/tcl85/trunk/files/sunmath-updated.diff	2009-01-22 22:01:46 UTC (rev 2888)
@@ -0,0 +1,117 @@
+Index: unix/tcl.m4
+===================================================================
+RCS file: /cvsroot/tcl/tcl/unix/tcl.m4,v
+retrieving revision 1.193
+diff -w -u -r1.193 tcl.m4
+--- unix/tcl.m4	27 Mar 2008 13:39:58 -0000	1.193
++++ unix/tcl.m4	1 Apr 2008 17:53:51 -0000
+@@ -1931,6 +1931,24 @@
+ 		], [AC_MSG_WARN([64bit mode not supported for $arch])])])
+ 	    ])
+ 	    
++	    #--------------------------------------------------------------------
++	    # On Solaris 5.x i386 with the sunpro compiler we need to link
++    	    # with sunmath to get floating point rounding control
++    	    #--------------------------------------------------------------------
++    	    AS_IF([test "$GCC" = yes],[use_sunmath=no],[
++		arch=`isainfo`
++	    	AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control])
++		AS_IF([test "$arch" = "amd64 i386"], [
++                        AC_MSG_RESULT([yes])
++			MATH_LIBS="-lsunmath $MATH_LIBS"
++                        AC_CHECK_HEADER(sunmath.h)
++			use_sunmath=yes
++        		], [
++			AC_MSG_RESULT([no])
++			use_sunmath=no
++        	])
++    	    ])
++	    
+ 	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
+ 	    # symbols when dynamically loaded into tclsh.
+ 
+@@ -1938,6 +1956,8 @@
+ 	    SHLIB_SUFFIX=".so"
+ 	    DL_OBJS="tclLoadDl.o"
+ 	    DL_LIBS="-ldl"
++
++
+ 	    AS_IF([test "$GCC" = yes], [
+ 		SHLIB_LD='${CC} -shared'
+ 		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+@@ -1952,11 +1972,12 @@
+ 		    #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ 		])
+ 	    ], [
++	        AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text])
+ 		case $system in
+ 		    SunOS-5.[[1-9]][[0-9]]*)
+-			SHLIB_LD='${CC} -G -z text ${LDFLAGS}';;
++			SHLIB_LD="${CC} -G -z $textmode \${LDFLAGS}";;
+ 		    *)
+-			SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
++			SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";;
+ 		esac
+ 		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ 		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+Index: generic/tclStrToD.c
+===================================================================
+RCS file: /cvsroot/tcl/tcl/generic/tclStrToD.c,v
+retrieving revision 1.33
+diff -w -u -r1.33 tclStrToD.c
+--- generic/tclStrToD.c	13 Mar 2008 17:14:19 -0000	1.33
++++ generic/tclStrToD.c	1 Apr 2008 17:53:49 -0000
+@@ -61,6 +61,13 @@
+ #   define ADJUST_FPU_CONTROL_WORD
+ #endif
+ 
++/* Sun ProC needs sunmath for rounding control on x86 like gcc above.
++ *
++ *
++ */
++#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
++#include <sunmath.h>
++#endif
+ /*
+  * HP's PA_RISC architecture uses 7ff4000000000000 to represent a quiet NaN.
+  * Everyone else uses 7ff8000000000000. (Why, HP, why?)
+@@ -1309,6 +1316,9 @@
+     _FPU_GETCW(oldRoundingMode);
+     _FPU_SETCW(roundTo53Bits);
+ #endif
++#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
++    ieee_flags("set","precision","double",NULL);
++#endif
+ 
+     /*
+      * Test for the easy cases.
+@@ -1381,6 +1391,9 @@
+ #if defined(__GNUC__) && defined(__i386)
+     _FPU_SETCW(oldRoundingMode);
+ #endif
++#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
++    ieee_flags("clear","precision",NULL,NULL);
++#endif
+ 
+     return retval;
+ }
+@@ -1427,6 +1440,9 @@
+     _FPU_GETCW(oldRoundingMode);
+     _FPU_SETCW(roundTo53Bits);
+ #endif
++#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
++    ieee_flags("set","precision","double",NULL);
++#endif
+ 
+     /*
+      * Quick checks for over/underflow.
+@@ -1485,6 +1501,9 @@
+ #if defined(__GNUC__) && defined(__i386)
+     _FPU_SETCW(oldRoundingMode);
+ #endif
++#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
++    ieee_flags("clear","precision",NULL,NULL);
++#endif
+     return retval;
+ }
+ 

Added: csw/mgar/pkg/tcl85/trunk/files/sunmath.diff
===================================================================
--- csw/mgar/pkg/tcl85/trunk/files/sunmath.diff	                        (rev 0)
+++ csw/mgar/pkg/tcl85/trunk/files/sunmath.diff	2009-01-22 22:01:46 UTC (rev 2888)
@@ -0,0 +1,161 @@
+Index: unix/tcl.m4
+===================================================================
+RCS file: /cvsroot/tcl/tcl/unix/tcl.m4,v
+retrieving revision 1.192
+diff -u -5 -r1.192 tcl.m4
+--- unix/tcl.m4	13 Mar 2008 17:44:22 -0000	1.192
++++ unix/tcl.m4	18 Mar 2008 23:55:46 -0000
+@@ -1928,18 +1928,38 @@
+ 			CFLAGS="$CFLAGS -xarch=amd64"
+ 			LDFLAGS="$LDFLAGS -xarch=amd64"
+ 		    ])
+ 		], [AC_MSG_WARN([64bit mode not supported for $arch])])])
+ 	    ])
++
++	    #--------------------------------------------------------------------
++	    # On Solaris 5.x i386 with the sunpro compiler we need to link
++    	    # with sunmath to get floating point rounding control
++    	    #--------------------------------------------------------------------
++    	    AS_IF([test "$GCC" = yes],[use_sunmath=no],[
++		arch=`isainfo`
++	    	AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control])
++		AS_IF([test "$arch" = "amd64 i386"], [
++                        AC_MSG_RESULT([yes])
++			MATH_LIBS="-lsunmath $MATH_LIBS"
++                        AC_CHECK_HEADER(sunmath.h)
++			use_sunmath=yes
++        		], [
++			AC_MSG_RESULT([no])
++			use_sunmath=no
++        	])
++    	    ])
+ 	    
+ 	    # Note: need the LIBS below, otherwise Tk won't find Tcl's
+ 	    # symbols when dynamically loaded into tclsh.
+ 
+ 	    SHLIB_LD_LIBS='${LIBS}'
+ 	    SHLIB_SUFFIX=".so"
+ 	    DL_OBJS="tclLoadDl.o"
+ 	    DL_LIBS="-ldl"
++
++
+ 	    AS_IF([test "$GCC" = yes], [
+ 		SHLIB_LD='${CC} -shared'
+ 		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ 		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ 		AS_IF([test "$do64bit_ok" = yes], [
+@@ -1950,16 +1970,17 @@
+ 		    # path, remove so name and append 'sparcv9'
+ 		    #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ 		    #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ 		])
+ 	    ], [
++                AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text])
+ 		case $system in
+ 		    SunOS-5.[[1-9]][[0-9]]*)
+-			SHLIB_LD='${CC} -G -z text';;
++			SHLIB_LD="${CC} -G -z $textmode";;
+ 		    *)
+-			SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+-		esac
++			SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";;
++		esac    
+ 		CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ 		LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ 	    ])
+ 	    ;;
+ 	UNIX_SV* | UnixWare-5*)
+@@ -2594,11 +2615,11 @@
+     # right (and it must appear before "-lm").
+     #--------------------------------------------------------------------
+ 
+     AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
+     AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
+-
++    
+     #--------------------------------------------------------------------
+     # Interactive UNIX requires -linet instead of -lsocket, plus it
+     # needs net/errno.h to define the socket-related error codes.
+     #--------------------------------------------------------------------
+ 
+Index: generic/tclStrToD.c
+===================================================================
+RCS file: /cvsroot/tcl/tcl/generic/tclStrToD.c,v
+retrieving revision 1.33
+diff -u -5 -r1.33 tclStrToD.c
+--- generic/tclStrToD.c	13 Mar 2008 17:14:19 -0000	1.33
++++ generic/tclStrToD.c	18 Mar 2008 23:55:50 -0000
+@@ -59,10 +59,17 @@
+ #define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
+ #   define FPU_IEEE_ROUNDING	0x027f
+ #   define ADJUST_FPU_CONTROL_WORD
+ #endif
+ 
++/* Sun ProC needs sunmath for rounding control on x86 like gcc above.
++ *
++ *
++ */
++#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
++#include <sunmath.h>
++#endif
+ /*
+  * HP's PA_RISC architecture uses 7ff4000000000000 to represent a quiet NaN.
+  * Everyone else uses 7ff8000000000000. (Why, HP, why?)
+  */
+ 
+@@ -1307,10 +1314,13 @@
+     fpu_control_t roundTo53Bits = 0x027f;
+     fpu_control_t oldRoundingMode;
+     _FPU_GETCW(oldRoundingMode);
+     _FPU_SETCW(roundTo53Bits);
+ #endif
++#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
++    ieee_flags("set","precision","double",NULL);
++#endif
+ 
+     /*
+      * Test for the easy cases.
+      */
+ 
+@@ -1379,10 +1389,13 @@
+      */
+ 
+ #if defined(__GNUC__) && defined(__i386)
+     _FPU_SETCW(oldRoundingMode);
+ #endif
++#if defined(__sun) && defined(__i386) 
++    ieee_flags("clear","precision",NULL,NULL);
++#endif
+ 
+     return retval;
+ }
+ 
+ /*
+@@ -1425,10 +1438,13 @@
+     fpu_control_t roundTo53Bits = 0x027f;
+     fpu_control_t oldRoundingMode;
+     _FPU_GETCW(oldRoundingMode);
+     _FPU_SETCW(roundTo53Bits);
+ #endif
++#if defined(__sun) && defined(__i386) 
++    ieee_flags("set","precision","double",NULL);
++#endif
+ 
+     /*
+      * Quick checks for over/underflow.
+      */
+ 
+@@ -1483,10 +1499,13 @@
+      */
+ 
+ #if defined(__GNUC__) && defined(__i386)
+     _FPU_SETCW(oldRoundingMode);
+ #endif
++#if defined(__sun) && defined(__i386) 
++    ieee_flags("clear","precision",NULL,NULL);
++#endif
+     return retval;
+ }
+ 
+ /*
+  *----------------------------------------------------------------------


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list