Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2018-11-01
15:52 • Closed ticket [1195167fff]: strtod() gets compiled into fixstrtod() plus 5 o... artifact: a2c269cc74 user: dgp
2018-10-30
17:38 • Ticket [840660e5a1] fixstrtod.c breaks cross compilation status still Open w... artifact: 5ae5ba9501 user: rkeene
2017-03-31
16:45 • Ticket [1195167fff] strtod() gets compiled into fixstrtod() status still Ope... artifact: 5531a40ed9 user: dgp
2006-12-20
08:06 • Ticket [1195167fff]: 4 changes artifact: 0387c56a04 user: coldstore
2005-12-01
20:32 • Add attachment bug1195167.diff to ticket [1195167fff] artifact: 7bdb2f2ec9 user: dkf
20:32 • Ticket [1195167fff] strtod() gets compiled into fixstrtod() status still Ope... artifact: 8361e74189 user: dkf
07:48 • Ticket [1195167fff]: 4 changes artifact: 3dea6c0d81 user: jcw
07:43 • Ticket [1195167fff]: 4 changes artifact: 1dad74b881 user: jcw
2005-05-30
12:46 • Ticket [1195167fff]: 4 changes artifact: c0eeeb0852 user: ivan_daniluk
2005-05-04
12:19 • New ticket [1195167fff]. artifact: 4fdfe78ed5 user: nobody

strtod() gets compiled into fixstrtod()

Closed / Fixed1195167fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 8 years ago
Descriptionplain2005-05-04 12:19:41
I cross-compile the latest tcl8.4.9 source code on a 
Linux x86 platform targetting an embedded PowerPC 
60x running Linux. The configure script determines that 
the strtod() function needs to be build for this platform, 
and for some reason it also determines that the fixstrtod
() function need to be build as well.
Because of the need for fixstrtod(), the build script adds 
the compiler switch -Dstdtod=fixstrtod to gcc. But this 
causes both strtod() (compat/strtod.c) and fixstrtod() 
(compat/fixstrtod.c) to be compiled into the single 
function fixstrtod(). (compat/fixstrtod.c contains 
an "#undef strtod" to undo this define locally, but 
compat/strtod.c does not). Since fixstrtod() references 
strtod(), subsequent linking fails.
Adding "#undef stdtod" to compat/strtod.c as well 
solves the problem.
ivan_danilukplain2005-05-30 12:46:51
Logged In: YES 
user_id=902311

I've got this bug also when crosscompiling tcl8.4.9 on x86
with uClibc.
It seems, configure script automatically marks strtod() as
buggy when detects crosscompiling enabled:
tcl8.4.9/unix/configure:6243:
...
if test "$cross_compiling" = yes; then
  tcl_cv_strtod_buggy=0
else
...

// note: zero value means "buggy" accordingly to configure
script

Solution with adding "#undef strtod" works for me, btw.
jcwplain2005-12-01 07:43:42
Logged In: YES 
user_id=1983

I can confirm for 8.4.11 that this is the only issue preventing a cross-compile of 
Tcl.  Am appending a patch which works around this in another way: omitting 
the strtod.c from the build.

-jcw
jcwplain2005-12-01 07:48:12
Logged In: YES 
user_id=1983

Hm... can't seem to attach a file in this bug report area.  I've placed it here 
instead: http://www.equi4.com/pub/etc/bug1195167.diff

-jcw
dkfplain2005-12-01 20:32:49
File Added - 158251: bug1195167.diff
coldstoreplain2006-12-20 08:06:51
Logged In: YES 
user_id=19214
Originator: NO

This is still a current problem with tcl8.5 recent CVS checkout.
dgpplain2017-03-31 16:45:43
This appears to be the last Open ticket that
still touches on the "fixstrtod" issue.

Tcl no longer uses the strtod() routine anywhere.
It can no longer suffer because of any brokenness
in any system strtod() routine.

In at least Tcl 8.7 and later, we should purge Tcl's
build machinery of all crutches, patches and other
heroism dedicated to solving a problem which has
not existed for years.  The solution is now far
more damaging, tripping up cross-compile efforts.
dgp Closed ticket [1195167fff]. [History diff]2018-11-01 15:52:46
Log in (anonymous is fine) to add a comment.

Attachments: