|
2013-10-17
| ||
| 13:47 | • Closed ticket [dfc08326e3]: Symbols not exported correctly plus 4 other chan... artifact: ebb5174841 user: jan.nijtmans | |
| 11:35 | • Ticket [dfc08326e3]: 3 changes artifact: 1fe3f1a51e user: jan.nijtmans | |
| 09:00 | Eliminate TclOOInitializeStubs() completely. This fixes [dfc08326e3], at least the TclOOInitializeSt... check-in: 5faca23620 user: jan.nijtmans tags: novem | |
|
2013-10-13
| ||
| 16:19 | The Tcl 9.0 way of how [dfc08326e3] should be fixed: Real integration of TclOO in Tcl means that cal... closed check-in: 6142b8e869 user: jan.nijtmans tags: rfe-dfc08326e3 | |
|
2013-10-02
| ||
| 18:30 | Better fix for bug [dfc08326e3] check-in: 0d8c808d43 user: jan.nijtmans tags: bug-dfc08326e3 | |
| 10:31 | • Ticket [dfc08326e3] Symbols not exported correctly status still Pending with... artifact: ba8e82fbe9 user: jan.nijtmans | |
| 10:09 | • Ticket [dfc08326e3]: 4 changes artifact: 377d95f320 user: dkf | |
| 10:05 | • Ticket [dfc08326e3]: 4 changes artifact: b928f534c2 user: dkf | |
|
2013-10-01
| ||
| 08:01 | • Ticket [dfc08326e3]: 3 changes artifact: 426d1b891d user: jan.nijtmans | |
|
2013-09-30
| ||
| 16:40 | • Ticket [dfc08326e3]: 4 changes artifact: 264675ad37 user: stwo | |
| 12:35 | • Ticket [dfc08326e3]: 3 changes artifact: 215d6c79c2 user: jan.nijtmans | |
| 10:13 | export tclOO symbols from the dll/so, as suggested in RFE [dfc08326e3], in addition to exporting it ... closed check-in: 8e25674013 user: jan.nijtmans tags: rfe-dfc08326e3 | |
| 10:13 | • Ticket [dfc08326e3] Symbols not exported correctly status still Pending with... artifact: e3ea1f22cc user: jan.nijtmans | |
| 09:15 | • Ticket [dfc08326e3]: 3 changes artifact: 280390006b user: jan.nijtmans | |
| 08:51 | • Pending ticket [dfc08326e3]. artifact: f2b22eb907 user: jan.nijtmans | |
|
2013-09-29
| ||
| 18:12 | • Ticket [dfc08326e3]: 5 changes artifact: 253a31746e user: stwo | |
| 12:49 | • Ticket [dfc08326e3]: 6 changes artifact: 1bb7fd24fb user: stwo | |
|
2013-09-28
| ||
| 21:10 | • Closed ticket [dfc08326e3]. artifact: ff96d66df2 user: dkf | |
| 21:10 | [dfc08326e3]: Corrected symbol export for TclOO to match Tcl so things work as expected in a static ... check-in: 371bcd0714 user: dkf tags: trunk | |
| 21:06 | • Ticket [dfc08326e3] Symbols not exported correctly status still Open with 4 ... artifact: 09c224ef0a user: dkf | |
| 21:03 | • Ticket [dfc08326e3]: 4 changes artifact: b9d8fa9264 user: dkf | |
|
2013-09-27
| ||
| 16:17 | • Ticket [dfc08326e3]: 5 changes artifact: 2b1150bb62 user: dkf | |
| 16:15 | • New ticket [dfc08326e3]. artifact: 8dabdaf7b2 user: stwo | |
Symbols not exported correctly
At least one is Tcl_GetObjectFromObj.
5faca23620Eliminate TclOOInitializeStubs() completely. This fixes [dfc08326e3], at least the TclOOInitializeStubs() surprise part of it. Further refactoring is possible, eliminating tclOOStubsPtr and/or tclOOIntStubsPtr. A discussion about that is opened on the Tcl Core List. This is fully source compatible for TclOO extensions (e.g. Itcl, tdbc) but binary incompatible. TODO: update documentation, but that can wait until the refactoring is complete. check-in2013-10-17 09:00:026142b8e869The Tcl 9.0 way of how [dfc08326e3] should be fixed: Real integration of TclOO in Tcl means that calling the function Tcl_OOInitStubs() should be elminated in full. This branch shows how to do that. check-in2013-10-13 16:19:440d8c808d43Better fix for bug [dfc08326e3] check-in2013-10-02 18:30:268e25674013export tclOO symbols from the dll/so, as suggested in RFE [dfc08326e3], in addition to exporting it through the stub table. check-in2013-09-30 10:13:59371bcd0714[dfc08326e3]: Corrected symbol export for TclOO to match Tcl so things work as expected in a static build. check-in2013-09-28 21:10:22
Was caused by [742bcc2aec], which changed the storage class of TclOO's symbols from EXTERN to TCLOOAPI, which is at variance with Tcl.
Suggested workaround: define TCLOOAPI to be extern in the Makefile when building Tcl.
The impact of the current situation is that TclOO's C API is unavailable to extensions that are statically linked with a statically-built Tcl (--disable-shared). This is not a supported configuration with the external package form of TclOO, but should be supported with Tcl 8.6 onwards; I intend to change this ASAP.
extern does not work for me but DLLEXPORT does
DLLEXPORT makes the symbols visible in the .so, not sure that that's right since it seems that I all I needed to do was to call Tcl_OOInitStubs. In 8.6.1 as released, after calling Tcl_OOInitStubs I can successfully call Tcl_GetObjectFromObj. So my problem doesn't seem to be a problem.
I am failing to see the improvement of this change. I tested it, and it doesn't cause any immediate problems either. As stwo commented, problably the only thing missing in his setup was the Tcl_OOInitStubs() call. The only disadvantage of this commit is that it would prevent creating a stub-enabled TclOO extension (e.g. Itcl) compiled against 8.5 headers, which statically links to tclOO (with a runtime-check for Tcl8.6). If the TclOO symbols are exported that would cause duplicate symbols, with stock Tcl 8.6.0 or 8.6.1 that wouldn't be problem. Since compiling Itcl with TclOO gives warnings (TclOONewProcInstanceMethodEx and TclOONewProcMethodEx have a different signature) and Itcl 4.0 with 8.5 appears not to be supported anyway, it really is no problem. Since Tcl 9.0 uses the TCL<PACKAGENAME>API convention everywhere, I would be very interested to know what's the problem with that approach. So far I am not aware of any problem, that's why I backported that from Tcl 9 to 8.6 for TclOO only. Reverting that change would be a pity. >This is not a supported configuration with the external package form >of TclOO, but should be supported with Tcl 8.6 onwards; I intend >to change this ASAP. I don't see any added value in supporting this: whether Tcl and/or TclOO are compiled as static or dynamic library is orthogonal to whether it's symbols are exported through the Stub table or as symbols or both from it's dynamic library. Calling Tcl_OOInitStubs() is the solution to any problem, as far as I know. I would recommend to revert this change, unless someone can point out a problem with the original appoach. Since tkImg and Tcl 9.0 use the TCL<PACKAGENAME>API approach as well, I'm very interested in any possible problems that might cause.
I just noted [f51efe99a7] and tried the same on MinGW. So I was wrong on assuming that this change didn't cause any problems :-(
See branch [rfe-dfc08326e3]. I fail to see any advantage in doing this, neither do I see any problems with it (provided it's done correctly not breaking the MinGW build, see also ticket [f51efe99a7])
I don't know why Fossil's annotate points to [742bcc2aec] as making this change. The real commit which made this change was [d952be86c1f4375f], the comment makes it fully clear why.
In [742bcc2aec] I committed the RFC patch by accident, but that commit was reverted immediately after. Apparent fossil's "annotate" is mislead by that.
Some more notes: The Tcl_OOInitStubs manpage is not installed as part of Tcl 8.6, and it isn't referenced in any of the installed OO manpages nor did I find much about it with Google. Tcl_PkgRequire(interp, "TclOO", "1.0", 0); returns non-NULL if Tcl_OOInitStubs is called or not. I consider myself a somehwat competant C programmer and it has not been an easy start to get working with TclOO at the C level. Others might have a similarly confusing experience.
For Tcl 9.0, all TclOO symbols should move from tcloo.decls to tcl.decls, and TclOO should not have a separate version number any more. That's what I expect from a really integrated TclOO. Then calling Tcl_OOInitStubs is no longer necessary. For Tcl 8.6 that cannot be changed any more without introducing binary incompatibilities (TclOO is already version 1.0), the best option left is improve the documentation. A Quick-Start guide for TclOO would be a good idea.
It's hardly my fault that you are WRONG, Jan.
There were problems with the wrong export rules being applied (now fixed) and I needed to ensure that when building without stubs enabled (only supported against a static Tcl 8.6) that the use of Tcl_OOInitStubs results in a suitable no-op (now fixed).
Existing code that built against TclOO in stub-enabled mode works as before. Nobody built against a static version, because that was broken (i.e., it could not be made to work without also linking the static stub library into the same binary, and that's a bad configuration). My changes make it so that that's now a supported build configuration, but only against Tcl 8.6.
And by the way, I never wanted you to commit [d952be86c1f4375f] anyway. I don't trust your decisions on API export macros and I think you have a history of making bad decisions. I just can't spend all my time reviewing every commit you make.
>I don't trust your decisions on API export macros and I think you have a history of making bad decisions. I'm sorry you feel that way. We differ in opinion on this, but that's OK.
Since TclOOInitializeStubs() is gone now in Tcl 9.0, I think everything discussed here is fixed. In trunk, the maximum has been done keeping binary compatility: A static build without using stubs now works. That appears to be what was desired, not how symbols are exported from the shared library. I agree with the change which accomplished that.
Much more code is reverted from trunk than justified by this ticket, but that's a separate issue that can be discussed elsewhere.
I also had a look how TclOOInitializeStubs() could be eliminated from Tcl 8.6, but I don't see any way to do that without risking breaking binary compatibility. [5faca23620] could be backported to 8.7 - if desired - (if the need for 8.7 ever arises)
Regards, Jan Nijtmans