Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TclThread_Init is not defined anywhere.

Closed / Invalid584307ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-07-20 21:13:45
I'm building tcl8.4b1 on Slackware Linux 8.0 w/ 2..18
kernel, glibc-2.2.5, binutils-2.12.1, XFree86-4.2.0,
and gcc-20020715 gcc-3.1.x snapshot and Tcl builds
fine, but tk8.4b1 testing fails because
"TclThread_Init" is NOT defined anywhere.

My configure command to build tcl8.4b1:

$ ./configure --prefix=/usr --enable-threads
--enable-shared

After building tcl8.4b1, I run THIS command:

tom@linux:~/tcl8.4b1/unix$ nm libtcl8.4.so | grep
TclThread_Init
tom@linux:~/tcl8.4b1/unix$ grep -r TclThread_Init * | more
tclAppInit.c:extern int         TclThread_Init
_ANSI_ARGS_((Tcl_Interp *interp));
tclAppInit.c:    if (TclThread_Init(interp) == TCL_ERROR) {
tom@linux:~/tcl8.4b1/unix$ 

During the compile of tcl, "-DTCL_THREADS=1" *is* being
passed to gcc (sample compile output):

gcc -pipe -c -O -D__NO_STRING_INLINES
-D__NO_MATH_INLINES -Wall -Wconversion
-Wno-implicit-int -fPIC -I./../generic -I.
-DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1
-DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1
-DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1
-DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1
-DHAVE_TYPE_OFF64_T=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
-DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1
-DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1
-DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1
-DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1
-DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1
-DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1
-DHAVE_SYS_IOCTL_H=1         -DTCL_SHLIB_EXT=\".so\"
./../generic/regcomp.c

Peace....

Tom
dgpplain2002-07-22 00:14:01
Logged In: YES 
user_id=80530


TclThread_Init() is defined in the
source code file generic/tclThreadTest.c.
This gets compiled into tclThreadTest.o
That object file is not linked into libtcl8.4.so
Instead, it is statically linked into the
tcltest executable.  The reference to
TclThread_Init() in tclAppInit.c is only
active when you are building the
tcltest executable.

Given all of that, there is nothing wrong
with the results you report.  So, I don't
know what problem you are really reporting.
You say "tk8.4b1 testing fails" but do not
provide any details on what you mean by
that.

Try a `make distclean` and start again.
If you still have trouble, post what you
did, and the actual error here, instead
of your attempts at post-analysis.
tomdkat2plain2002-07-22 00:39:01
Logged In: YES 
user_id=417062

Ask and ye shall receive.....

When I build tk8.4b1:

tom@linux:~/tk8.4b1/unix$ ./configure --prefix=/usr
--enable-threads --enable-shared
[configure output]
tom@linux:~/tk8.4b1/unix$ make
[builds fine]
tom@linux:~/tk8.4b1/unix$ make test
gcc -pipe -c -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES
-Wall -Wconversion -Wno-implicit-int -fPIC
-I/home/tom/tk8.4b1/unix -I/home/tom/tk8.4b1/unix/../generic
-I/home/tom/tk8.4b1/unix/../bitmaps
-I/home/tom/tcl8.4b1/generic -I/usr/X11R6/include
-DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1
-DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1
-DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1
-DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1
-DHAVE_TYPE_OFF64_T=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1
-DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1     
-DTCL_NO_DEPRECATED -DTK_TEST
/home/tom/tk8.4b1/unix/tkAppInit.c
rm -f tkTestInit.o
mv tkAppInit.o tkTestInit.o
gcc -pipe -c -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES
-Wall -Wconversion -Wno-implicit-int -fPIC
-I/home/tom/tk8.4b1/unix -I/home/tom/tk8.4b1/unix/../generic
-I/home/tom/tk8.4b1/unix/../bitmaps
-I/home/tom/tcl8.4b1/generic -I/usr/X11R6/include
-DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1
-DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1
-DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1
-DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1
-DHAVE_TYPE_OFF64_T=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1
-DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1     
-DTCL_NO_DEPRECATED
/home/tom/tk8.4b1/unix/../generic/tkTest.c
gcc -pipe -c -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES
-Wall -Wconversion -Wno-implicit-int -fPIC
-I/home/tom/tk8.4b1/unix -I/home/tom/tk8.4b1/unix/../generic
-I/home/tom/tk8.4b1/unix/../bitmaps
-I/home/tom/tcl8.4b1/generic -I/usr/X11R6/include
-DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1
-DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1
-DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1
-DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1
-DHAVE_TYPE_OFF64_T=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1
-DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1     
-DTCL_NO_DEPRECATED
/home/tom/tk8.4b1/unix/../generic/tkSquare.c
make tktest-real
LIB_RUNTIME_DIR=`pwd`:/home/tom/tcl8.4b1/unix
make[1]: Entering directory `/home/tom/tk8.4b1/unix'
gcc -pipe -rdynamic  tkTestInit.o tkTest.o tkSquare.o \
        -L/home/tom/tk8.4b1/unix -ltk8.4 \
        -L/home/tom/tcl8.4b1/unix -ltcl8.4  -lpthread
-L/usr/X11R6/lib -lX11 -ldl -lieee -lm
-Wl,-rpath,/home/tom/tk8.4b1/unix:/home/tom/tcl8.4b1/unix:/usr/X11R6/lib
-o tktest
tkTest.o: In function `Tktest_Init':
tkTest.o(.text+0x340): undefined reference to
`TclThread_Init'
collect2: ld returned 1 exit status
make[1]: *** [tktest-real] Error 1
make[1]: Leaving directory `/home/tom/tk8.4b1/unix'
make: *** [tktest] Error 2
tom@linux:~/tk8.4b1/unix$ 

Peace....

Tom
dgpplain2002-07-22 04:14:09
Logged In: YES 
user_id=80530


Now I understand.  I misread the report
because you should have filed it
with the Tk project instead of the Tcl
project.

This is a bug in the 8.4b1 release of Tk.
It has been fixed for the 8.4b2 release,
or you can get the fix now in the
nightly snapshots from CVS.

See the 2002-07-09 entry of the Tk ChangeLog.
tomdkat2plain2002-07-22 05:33:29
Logged In: YES 
user_id=417062

Ok.. thanks for the info.  The ONLY reason I reported by
problem HERE (in Tcl land) is because a Tcl module was
mentioned and I figured the "TclThread_Init" function would
have been or should have been in the libtcl8.4.so library. 
I didn't know that was used MAINLY for testing, otherwise I
would have reported the problem in the Tk area.

Thanks!

Peace...

Tom
Log in (anonymous is fine) to add a comment.