[Starkit] loading relocatable libraries using tclkit

Jeff Hobbs jeffh at ActiveState.com
Tue May 24 18:22:03 CEST 2005


Are you sure that you have compiled your extension with Tcl stubs enabled?
That is required in order to use a Tcl extension in a starkit.  Otherwise, the
dlopen should operate similarly in the tclkit vs. tclsh.  It will use the
LD_LIBRARY_PATH, etc.

  Jeff Hobbs, The Tcl Guy
  http://www.ActiveState.com/, a division of Sophos 

-----Original Message-----
From: starkit-bounces at equi4.com [mailto:starkit-bounces at equi4.com] On Behalf
Of arnaldo yokomizo
Sent: May 23, 2005 9:13 AM
To: starkit at equi4.com
Subject: [Starkit] loading relocatable libraries using tclkit



I have been trying to load a large relocatable library in C++, made up of both
our own code and third-party libraries.

 

When I use the "load <xxx>..so" command in tclsh, it does work fine, but when
I do the same in 'tclkit', it core-dumps. I am running my application on a Sun
SparcStation and Solaris.

 

By debugging using 'dbx', I found out that it core dumps while trying to
resolve static variable initialization in the libraries while calling system
routine 'dlopen()'. 'dlopen' just loads the relocatable library. 

 

For the libraries for which I have the source code, I either changed the order
of the libraries when I create my relocatable library, or changed the source
code so that it does not cause cross-initialization issues. But I cannot
resolve that for my third-party libraries, and I don't even know if there is
an optimal order for resolving unreferenced symbols AND initializing static
variables.

 

It seems to me that 'dlopen()' is called in 'tclsh' in relaxed mode, but it is
called in 'starkit' in strict, close mode. That would explain why I can load
the library in 'tclsh', but not in 'tclkit'. Is that right?

 

Is there any solution to my problem? Is there any other way I can have my
libraries loaded in 'tclkit' ?

 

Thanks for your advice.

 

Arnaldo

---------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.equi4.com/pipermail/starkit/attachments/20050524/b15d982a/attachment.htm


More information about the Starkit mailing list