Share

Tk Toolkit

Tracker: Bugs

5 Static compling of 8.6 in msys/mingw - ID: 2875562
Last Update: Settings changed ( nijtmans )

I tried compiling 8.6 from the cvs in a msys/mingw enviroment using the
--disable-shared option.

Tcl went well but compiling Tk failed with the message:

gcc -O2 -fomit-frame-pointer winMain.o
"/c/tmp/TclKitLite/tcl-8.6/tcl/win/libtcl86ss.a" libtk86s.a -lws2_32
-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32
\
wish.res.o -o wish86s.exe -mwindows
libtk86s.a(tkWindow.o):tkWindow.c:(.text+0x18): undefined reference to
`tclStubsPtr'
libtk86s.a(tkWindow.o):tkWindow.c:(.text+0x4f): undefined reference to
`tclStubsPtr'
[...]

Should it be trying to use stubs in a static build?


Andres Garcia Garcia ( fandom ) - 2009-10-09 08:52

5

Open

Fixed

Pat Thoyts

85. Win Build

development: 8.6b1.1

Public


Comments ( 13 )

Date: 2009-10-22 11:46
Sender: nijtmans

Reply to Andres:

That's true, but it's an unrelated Tcl bug, which
probably affects Tcl 8.5 as well. Therefore, I
created a new [Tcl Bug #2883850]:
"pkgIndex.tcl doesn't get created with static Tcl build"


Date: 2009-10-22 08:27
Sender: fandomSourceForge.net SubscriberAccepting Donations

Thank you, tk now compiles and install fine.

But, could please check whether 'package require registry' works for you?
In my case, pkgIndex.tcl doesn't get created for the extension while it is
when compiling with shared libraries.

Thanks


Date: 2009-10-21 21:24
Sender: nijtmans

Fixed in HEAD (Makefile.in 1.85). I don't undertand the remark about
stubbed linking with the TclOO API. Tk doesn't use the TclOO API,
this change only potentially involves extenions with involve Tk
(expecttk, blt ....), and only when linking with the static Tk library
(as in starpack's). Please review, anyone who feels like it!
At least the bug is fixed, but further improvements are possible,
therefore leaving the issue open.


Date: 2009-10-21 13:38
Sender: dkf

FWIW, I *only* support stubbed linking with the TclOO API.


Date: 2009-10-21 11:54
Sender: nijtmans

OK, here is the fix. In fact we have a choice whether we compile libtk.a
with or without stubs. Compiling with stubs has the advantage that the same
libtk.a
can be linked with either libtk.a and libtk.so.. If we compile libtka.
without
stubs, then it needs to be linked with libtcl.a if tcl was compiled
statically
and it needs to be linked with libtcl.so if Tcl was compiled dynamically.

But the disadvantage is that every application or extension which links
with libtk.a needs to link with libtclstub.a as well.

Pat, do you agree with this approach? If you want, you
can assign it to me then I will check this in. Or you
can evaluate it and do it yourself. Whatever you prefer.

An improvement could be to make tclStubLib.o and
tclOOStubLib.o part of libtk.a. Then applications who
link with libtk.a don't have to link with libtclstub.a any
more. But that's not trivial.


Date: 2009-10-21 10:28
Sender: nijtmans

Yes, I reproduced it, so there indeed is something broken in HEAD.
Preparing a patch now.


Date: 2009-10-19 20:09
Sender: dgpProject Admin


So is something still broken in HEAD of Tk, and if so what is
it and how do we fix it?



Date: 2009-10-19 20:09
Sender: dgpProject Admin


From the 8.6a1 release notes:

" * C code compiled with USE_TCL_STUBS now must be linked against a
stub library. The Tcl shared library no longer exports variables
used in the stub interface. Analogous changes also made to Tk.
*** POTENTIAL INCOMPATIBILITY ***
"


Date: 2009-10-19 20:03
Sender: dgpProject Admin


From the Tcl changes file:

2008-04-01 (interface)[1819422] tclStubsPtr no longer in libtcl (porter)
*** POTENTIAL INCOMPATIBILITY ***



Date: 2009-10-16 07:53
Sender: nijtmans

I'm sure this one is introduced by [Bug 1819422]
"tclStubsPtr out of libtcl", so it is indeed limited
to 8.6 only. I guess it is Windows specific as well,
as UNIX is less critical in this respect. Maybe
this change (a good one, in my view!) should
have been marked with POTENTIAL
INCOMPATIBILITY, because it might be
that other extensions need to be be modified
when they make the same mistake as Tk,
assuming that tclStubsPtr is available in
libtcl.a


Date: 2009-10-15 15:34
Sender: dkf

8.5.8 hasn't been released yet. Best approximation right now is the tip of
the core-8-5-branch.


Date: 2009-10-15 15:11
Sender: fandomSourceForge.net SubscriberAccepting Donations

Tcl/Tk 8.5.7 compiles fine with --disable-shared. I don't really know how
to get 8.5.8 out of cvs.


Date: 2009-10-15 13:19
Sender: dgpProject Admin

Is this problem limited to 8.6, or does 8.5.7 or 8.5.8 suffer
from the same problem?


Attached File ( 1 )

Filename Description Download
patch.diff fix for Bug #2875562 Download

Changes ( 6 )

Field Old Value Date By
priority 9 2009-10-22 11:46 nijtmans
resolution_id None 2009-10-21 21:24 nijtmans
File Added 347568: patch.diff 2009-10-21 11:39 nijtmans
priority 5 2009-10-19 20:09 dgp
artifact_group_id None 2009-10-19 20:06 dgp
assigned_to mdejong 2009-10-12 17:31 dgp