Tcl Source Code

View Ticket
Login
Ticket UUID: 1071701
Title: --enable-threads fails on sparc solaris 8
Type: Bug Version: obsolete: 8.5a2
Submitter: lvirden Created on: 2004-11-23 13:35:50
Subsystem: 53. Configuration and Build Tools Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-11-25 08:17:44
Resolution: Fixed Closed By: dgp
    Closed on: 2004-11-25 01:00:08
Description:
I extracted the tcl 8.4.8 source this morning.
I do the following:

export CC=cc
cd tcl8.4.8/unix
./configure --prefix=/tmp/tcl --enable-shared
--enable-symbols --enable-stubs --enable-threads

and the output I get I will attach to this report.

The bottom line error is this:
checking for readdir_r... yes
configure: error: unknown number of args for readdir_r

and in config.log I see:

configure:5031: cc -c   conftest.c >&5
"configure", line 5040: cannot find include file:
<sys/dir.h>
cc: acomp failed for conftest.c
configure:5034: $? = 2
configure: failed program was:
| #line 5013 "configure"
| /* confdefs.h.  */
| 


The man page for readdir_r on Solaris says this:

NAME
     readdir, readdir_r - read directory

SYNOPSIS
     #include <sys/types.h>
     #include <dirent.h>

     struct dirent *readdir(DIR *dirp);

     struct dirent *readdir_r(DIR *dirp, struct dirent
*entry);

POSIX
     cc [ flag ... ] file ...
-D_POSIX_PTHREAD_SEMANTICS [ library ... ]

     int readdir_r(DIR *dirp, struct dirent *entry,
struct dirent
     **result);
User Comments: dgp added on 2004-11-25 08:17:44:
Logged In: YES 
user_id=80530

...and backported for 8.4.9

dgp added on 2004-11-25 08:00:07:
Logged In: YES 
user_id=80530

yes, that patch does the trick.
Committing for widespread testing...

dgp added on 2004-11-25 07:33:34:

File Added - 110025: 1071701.patch

dgp added on 2004-11-25 07:33:33:
Logged In: YES 
user_id=80530

testing the attached patch...

dgp added on 2004-11-25 06:51:32:
Logged In: YES 
user_id=80530


the difference is that when
tclUnixThrd.c is compiled,
-D_POSIX_PTHREAD_SEMANTICS
is active, enabling the 3-argument
form.

During the configure testing, that
macro is not defined, so the 2-argument
form is configured for.

dgp added on 2004-11-25 06:27:25:

File Added - 110018: config.log

dgp added on 2004-11-25 06:27:24:
Logged In: YES 
user_id=80530


No joy.

Although the configure script
completes, the compile fails:

cc -c -O   -KPIC -I. -I../unix -I../unix/../generic
-DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\"
-DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\"
-DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
-DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1
-DHAVE_SYS_PARAM_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1
-DUSE_THREAD_STORAGE=1 -D_REENTRANT=1 -D_THREAD_SAFE=1
-DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1
-DHAVE_TWO_ARG_READDIR_R=1
-DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DSTATIC_BUILD=1
-D_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1
-DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1
-DTCL_CFG_DEBUG=1 -DTCL_WIDE_INT_TYPE=long\ long
-DHAVE_STRUCT_DIRENT64=1 -DHAVE_STRUCT_STAT64=1
-DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1
-DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1
-DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1
-DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1
-DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1
-DHAVE_TZNAME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1
-DHAVE_MKTIME=1 -DHAVE_TIMEZONE_VAR=1
-DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_ST_BLKSIZE=1
-Dstrtod=fixstrtod -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1
-DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1
-DTCL_UNLOAD_DLLS=1 -DTCL_DBGX=       ../unix/tclUnixThrd.c
"../unix/tclUnixThrd.c", line 888: prototype mismatch: 2
args passed, 3 expected
cc: acomp failed for ../unix/tclUnixThrd.c

config.log attached.

dgp added on 2004-11-25 06:13:13:
Logged In: YES 
user_id=80530

testing...

mdejong added on 2004-11-25 06:04:40:

File Added - 110017: readdir.patch

mdejong added on 2004-11-25 06:04:39:
Logged In: YES 
user_id=90858

Could someone test out this new patch for the CVS HEAD?
It should fix the problem.

dkf added on 2004-11-25 06:00:42:
Logged In: YES 
user_id=79902

Pasting from the chat...
<jenglish>
OK, wisdom according to Google indicates that the only
reason "readdir()" is considered not-thread-safe is because
"multiple threads using readdir() on the same DIRSTREAM may
overwrite the return value".

dgp added on 2004-11-25 05:00:46:
Logged In: YES 
user_id=80530

confirmed on Solaris 9.

Appears to be new failure
resulting from the "fix"
for 1001325.

kbk's attempt to fix other
breakage haven't yet solved
this platform.

lvirden added on 2004-11-23 20:43:34:
Logged In: YES 
user_id=15949

Note that I misspoke - it was not tcl 8.4.8, but the latest
tcl 8.5a2 , that
was failing.  I was thinking about working on 8.4.8 as I was
updating
my 8.5a2 build.

Sorry for the misspoken comment above.

lvirden added on 2004-11-23 20:35:52:

File Added - 109795: SparcSolaris8Suncc.txt

Attachments: