Menu

#519 tclStubsPtr out of libtcl

closed-accepted
None
5
2008-04-01
2007-10-24
Don Porter
No

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.

Discussion

  • Don Porter

    Don Porter - 2007-10-24
     
  • Don Porter

    Don Porter - 2007-10-24

    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

     
  • Don Porter

    Don Porter - 2007-10-24
     
  • Joe English

    Joe English - 2007-10-24

    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.

     
  • Don Porter

    Don Porter - 2007-10-24

    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.

     
  • Don Porter

    Don Porter - 2008-04-01

    Logged In: YES
    user_id=80530
    Originator: YES

    Committed for 8.6a0.

     
  • Don Porter

    Don Porter - 2008-04-01
    • assigned_to: jenglish --> dgp
    • status: open --> closed-accepted
     
  • Daniel A. Steffen

    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

     
  • Daniel A. Steffen

     
  • Daniel A. Steffen

     
  • Daniel A. Steffen

    Logged In: YES
    user_id=90580
    Originator: NO

    MODULE_SCOPE patches committed to HEAD
    File Added: tk-stubs-modulescope.diff

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.