> > I decided to give the patch Mo mentioned below a try. It works when I
> > try it with Java executing some simple Tcl commands, but now I'm trying
> > to use it with some pretty complex Tcl packages, and I get a
> > tcl.lang.TclException that says:
> >
> > couldn't load file "/iw/tcl/current/lib/TclExpat-1.1/tclexpat.so":
> > ld.so.1: /usr/java/bin/../bin/sparc/native_threads/java: fatal:
> > relocation error: file
> > /iw/tcl/current/lib/TclExpat-1.1/tclexpat.so: symbol
> > Tcl_GetStringFromObj: referenced symbol not found
>
>
> Yikes. That is really odd. You might be running into some
> goofy junk related to how the JVM loads shared libs and
> how Tcl loads shared libs. For instance, you need to
> load libtclblend.so in Tcl and in Java (with System.loadLibrary()),
> but I do not know if that matters.
Hmm, based the above I tried explicitly telling the interpreter to load
/iw/tcl/current/lib/libtcl8.3g.so using the Java code:
theInterp.eval("load /iw/tcl/current/lib/libtcl8.3g.so");
just before the part of the code that was causing the relocation error, but
that causes a different error to happen before I even get to the place that
was getting the relocation error:
caught tcl.lang.TclException: Can't find tclx.tcl in the following
directories:
/usr/local/lib/tclX8.2
/home/dnew/perforce/openSource/Release/tcl/8.3.0/lib/tclX8.2
./lib/tclX8.2
./tclX8.2/tcl/.
./tclX8.2/tcl/
> > Tcl_GetStringFromObj is a procedure defined in Tcl (in
> > generic/tclObj.c), so somehow when I have Java invoke the Tcl
> > interpreter it's not finding this routine. I thought it might be a
> > problem with my LD_LIBRARY_PATH causing it to load a version of Tcl
> > that doesn't define this routine, but I truss'd the Java process and
> > found that the version of the library that it's opening is
> > /iw/tcl/current/lib/libtcl8.3g.so, and then I did the following:
> > % nm -og /iw/tcl/current/lib/libtcl8.3g.so | fgrep
Tcl_GetStringFromObj
> > [2873] |000002275540|000000000300|FUNC |GLOB
> > |0 |8 |Tcl_GetStringFromObj
>
> Is there any chance that tclexpat.so is linked to another
> Tcl shared lib?
>
> Try running:
>
> % ldd tclexpat.so
>
> and see if that says something about libtcl8.3g.so in the link dep line.
I tried
ldd /iw/tcl/current/lib/TclExpat-1.1/tclexpat.so
but it showed no dependencies at all (nothing printed).
> > So, it seems the function *is* defined in the .so file it's accessing.
> >
> > Any ideas what might be going on, or how I might try to debug it?
>
> You might also want to try building tclexpat.so with stubs
> support. That might work a little better.
I don't know what "stubs support" means in this context. Can you please
elaborate? Thanks
- Mike
----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
An archive is available at http://www.mail-archive.com/[email protected]