Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2009-12-08
00:16 • Closed ticket [2902010fff]: 2819200 fix breaks Tcl on MIPS on Linux plus 7 o... artifact: e1ae3b79fa user: dgp
00:16 • Ticket [2902010fff]: 4 changes artifact: a9d7f749d3 user: dgp
2009-11-26
17:42 • Ticket [2902010fff]: 4 changes artifact: 61c0a19d51 user: teopetuk
02:01 • Pending ticket [2902010fff]. artifact: f0b041f5b6 user: dgp
02:01 • Ticket [2902010fff]: 4 changes artifact: f748e8f4fc user: dgp
02:01 • Add attachment 2819200.patch to ticket [2902010fff] artifact: d074349507 user: dgp
2009-11-23
13:13 • Ticket [2902010fff] 2819200 fix breaks Tcl on MIPS on Linux status still Ope... artifact: 5580b8689d user: teopetuk
10:37 • Ticket [2902010fff]: 4 changes artifact: ebf2c03a1b user: stwo
07:09 • Ticket [2902010fff]: 4 changes artifact: 6c93a99f5c user: dgp
2009-11-22
11:15 • New ticket [2902010fff]. artifact: 192c225771 user: teopetuk

2819200 fix breaks Tcl on MIPS on Linux

Closed / Fixed2902010fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2009-11-22 11:15:50
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.
dgpplain2009-11-23 07:09:13
what compiler is used when the failure is observed?
stwoplain2009-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();
teopetukplain2009-11-23 13:13:13
GCC 4.3.4 was used, but the failure doesn't depend on GCC version.
dgpplain2009-11-26 02:01:21
File Added - 352541: 2819200.patch
dgpplain2009-11-26 02:01:58
Please test the attached patch.
teopetukplain2009-11-26 17:42:56
Works for Debian Linux (tested with GCC 4.2).
dgpplain2009-12-08 00:16:33
Thanks for testing!

Fix committed for 8.5.9 and 8.6b2.
dgpplain2009-12-08 00:16:49
allow_comments - 1
Log in (anonymous is fine) to add a comment.

Attachments: