BladeSystem Forums have moved here
To make BladeSystem information easier to find, we have moved the BladeSystem forums here, to Servers and Operating Systems.
Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

Can't dlopen() a library containing Thread Local Storage - Incorrect path beinh taken

Occasional Advisor

Can't dlopen() a library containing Thread Local Storage - Incorrect path beinh taken

I have built an executable that dlopens a shared lib. Both the exe and the lib are PARISC1.1.

The shared lib thats dlopen'ed by the exe is dependent on libjvm.sl. While building the shared lib, I have used -Wl,+s linker option and used java1.4 for linking i.e. something like -L/opt/java1.4/jre/lib/PA_RISC/server/ -ljvm.

However, when I am testing ans trying to run the exe on another machine that has java 1.5, I get an error saying that

Can't dlopen() a library containing Thread Local Storage: /opt/java1.4/jre/lib/PA_RISC/server//libjvm.sl

I am getting this even though I have set SHLIB_PATH to java1.5 paths and also set LD_PRELOAD to java1.5 libjvm.sl. Why is the SHLIB_PATH not being taken even when +s linker flag has been specified while building the shared lib?

Can someone help me out?
1 REPLY
Highlighted
Acclaimed Contributor

Re: Can't dlopen() a library containing Thread Local Storage - Incorrect path beinh taken

You seemed to have used the right options and ENV vars.

I suppose for your "other" machine, you could try to use the java1.4 libs to see if that works.

Otherwise try using ldd(1) to see why the variables aren't working:

export SHLIB_PATH=...
LD_PRELOAD=.../java1.5/.../libjvm.sl ldd your-shlib

See if there is more than one libjvm.sl?

Can you show us the chatr(1) output on your shlib?

I suppose you could also use tusc to see what libs are being opened during loading.