Tcl Source Code

View Ticket
Login
Ticket UUID: 2902010
Title: 2819200 fix breaks Tcl on MIPS on Linux
Type: Bug Version: obsolete: 8.5.8
Submitter: teopetuk Created on: 2009-11-22 11:15:50
Subsystem: 48. Number Handling Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2009-12-08 00:16:49
Resolution: Fixed Closed By: dgp
    Closed on: 2009-12-07 17:16:49
Description:
Hi!

Appears that the fix for bug 2819200 breaks Tcl on MIPS architecture on Linux OS (at least on Debian). Debian (I'm not sure about other Linux distributions) doesn't have <sys/fpu.h>, so It becomes impossible to build 8.5.8 on it (see https://buildd.debian.org/fetch.cgi?pkg=tcl8.5&arch=mips&ver=8.5.8-1&stamp=1258718436&file=log&as=raw for details). On the other hand, removing the patch from 2819200 makes Tcl 8.5.8 build fine and pass test suite without errors (I did the experiment in Qemu, so the result for a real hardware may differ).

It's likely that changing FPU settings isn't required (and isn't even possible?) in Linux, so the code from 2819200 shouldn't be called for Linux.
User Comments: dgp added on 2009-12-08 00:16:49:

allow_comments - 1

dgp added on 2009-12-08 00:16:33:
Thanks for testing!

Fix committed for 8.5.9 and 8.6b2.

teopetuk added on 2009-11-26 17:42:56:
Works for Debian Linux (tested with GCC 4.2).

dgp added on 2009-11-26 02:01:58:
Please test the attached patch.

dgp added on 2009-11-26 02:01:21:

File Added - 352541: 2819200.patch

teopetuk added on 2009-11-23 13:13:13:
GCC 4.3.4 was used, but the failure doesn't depend on GCC version.

stwo added on 2009-11-23 10:37:47:
This also breaks OpenBSD/MIPS.
I'm waiting for a more detailed report from the person who reported this to me.
Meanwhile, this patch is being used, supplied for informational purposes.
No idea what the fix should be.

--- generic/tclStrToD.c.orig    Sun Nov 22 13:37:00 2009
+++ generic/tclStrToD.c    Sun Nov 22 13:39:08 2009
@@ -73,7 +73,7 @@ typedef unsigned int fpu_control_t __attribute__ ((__m
  * MIPS floating-point units need special settings in control registers
  * to use gradual underflow as we expect.
  */
-#if defined(__mips)
+#if defined(__mips) && !defined(__OpenBSD__)
#include <sys/fpu.h>
#endif
/*
@@ -2166,7 +2166,7 @@ TclInitDoubleConversion(void)
     } bitwhack;
#endif

-#if defined(__mips)
+#if defined(__mips) && !defined(__OpenBSD__)
     union fpc_csr mipsCR;

     mipsCR.fc_word = get_fpc_csr();

dgp added on 2009-11-23 07:09:13:
what compiler is used when the failure is observed?

Attachments: