Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-04-03
04:41 • Ticket [1819422fff] tclStubsPtr out of libtcl status still Closed with 4 oth... artifact: 202f6540e0 user: das
04:41 • Add attachment tk-stubs-modulescope.diff to ticket [1819422fffffffff|18... artifact: 249918f4d8 user: das
04:40 • Add attachment tcl-stubs-modulescope.diff to ticket [1819422fffffffff|1... artifact: 0ff43197c7 user: das
04:40 • Ticket [1819422fff] tclStubsPtr out of libtcl status still Closed with 4 oth... artifact: 5942b09e51 user: das
2008-04-01
23:33 • Closed ticket [1819422fff]. artifact: c08d08a60f user: dgp
2007-10-24
23:49 • Ticket [1819422fff]: 4 changes artifact: 0b39983068 user: dgp
23:32 • Ticket [1819422fff]: 4 changes artifact: 72a4f42e11 user: jenglish
23:29 • Ticket [1819422fff]: 4 changes artifact: e5f6bb1757 user: dgp
23:29 • Add attachment 1819422.patch to ticket [1819422fff] artifact: c80bb287c6 user: dgp
23:19 • Add attachment tclStubsPtr.patch to ticket [1819422fffffffff|1819422fff... artifact: 0e60574495 user: dgp
23:19 • Ticket [1819422fff] tclStubsPtr out of libtcl status still Open with 4 other... artifact: ffcca76c54 user: dgp
16:19 • New ticket [1819422fff]. artifact: 41579057a6 user: dgp

tclStubsPtr out of libtcl

Closed / Accepted1819422fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-10-24 16:19:01
Attached patch takes the
global C variable "tclStubsPtr"
out of the Tcl library, where
it arguably does not belong
in the first place.

"tclStubsPtr" is something
the Tcl stubs library needs, 
not the Tcl library.

Please review the patch.
dgpplain2007-10-24 23:19:01
File Added - 251165: tclStubsPtr.patch
dgpplain2007-10-24 23:29:28
File Added - 251166: 1819422.patch

Logged In: YES 
user_id=80530
Originator: YES


One thing this patch breaks
is the building of a static wish:

/home/dgp/cvs/tk/unix/libtk8.5.a(tkStubLib.o): In function `Tk_InitStubs':
tkStubLib.c:(.text+0x16): undefined reference to `tclStubsPtr'
tkStubLib.c:(.text+0x111): undefined reference to `tclStubsPtr'
tkStubLib.c:(.text+0x14f): undefined reference to `tclStubsPtr'
collect2: ld returned 1 exit status


Closer examination shows that this is
because the static build configuration
for wish implies no USE_TCL_STUBS during
the compile, and a link against libtcl
instead of libtclstubs.  This conflicts
with the code for Tk_InitStubs() in
generic/tkStubLib.c where code in the
source file itself forces the enabling
of USE_TCL_STUBS.  Why?!  

The attached patch for Tk inherits the
genstubs changes, as well as dropping
the forced USE_TCL_STUBS from tkStubLib.c.
Applying this patch makes static wish
build just fine.

Perhaps an even better answer is
to iterate on this reform, and
get tkStubsPtr and Tk_InitStubs()
out of libtk.  I think that would
also solve the issue.

File Added: 1819422.patch
jenglishplain2007-10-24 23:32:29
Logged In: YES 
user_id=68433
Originator: NO

See also discussion in #1716117.

I thought we decided to leave things as-is for 8.5?  (2007-05-16 11:35 comment).

Will look at the patch later.
dgpplain2007-10-24 23:49:25
Logged In: YES 
user_id=80530
Originator: YES


ah. there it is.

missed it since I searched
the Tcl tracker instead of Tk.

Got interested in the issue
again since I thought it might
be related to Bug 1792432.

Fine with me if these patches
sit for now, with intent to
re-examine/adopt early in 8.6
development.
dgpplain2008-04-01 23:33:23
Logged In: YES 
user_id=80530
Originator: YES


Committed for 8.6a0.
dasplain2008-04-03 04:40:38
File Added - 272948: tcl-stubs-modulescope.diff

Logged In: YES 
user_id=90580
Originator: NO

attached patches that
- make the symbols in libtclstub and libtkstub MODULE_SCOPE to avoid exporting them from extension shared libraries linked with the stub libs
- constify the *StubsPtr and stub table hook pointers
- fix USE_TCL_STUBS defines in tkStubLib.c and ttkStubLib.c
- remove now unnecessary unexporting of libtclstub symbols from libtk.
File Added: tcl-stubs-modulescope.diff
dasplain2008-04-03 04:41:32
File Added - 272949: tk-stubs-modulescope.diff

Logged In: YES 
user_id=90580
Originator: NO

MODULE_SCOPE patches committed to HEAD
File Added: tk-stubs-modulescope.diff
Log in (anonymous is fine) to add a comment.

Attachments: