Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to ignore LD_LIBRARY_PATH for a shared library

807575Jul 8 2004 — edited Jul 13 2004
I am compiling a dynamicly linked library that cannot use the LD_LIBRARY_PATH.

I am using SunWSpro as a compiler.

My problem is that the program that runs this code inserts a bunch of directories infront of my LD_LIBRARY_PATH env var that have files that are the same name as the ones my library links to but those files are basically a wrong version let alone shared mem issues they introduce.

I know with GCC there is a -Rpath where you can explicidly set the "Search Path" for the lib. CC has a similar switch "-R" that, according to the documentation, does the same but it doesnt work. As well as a "-i" that suposidely ignores the LD_LIBRARY_PATH but it only does so on compile.

So if I do a ldd -s on my lib I get this:
find object=libc.so.1; required by /usr/platform/SUNW,Sun-Fire-280R/lib/libmd5_psr.so.1
search path=./:/usr/java/jre/lib/sparc:/usr/java/jre/lib/sparc/native_threads:/usr/java/jre/lib/sparc:/usr/local/lib:/usr/lib:/lib:/export/home/notes/Tester (LD_LIBRARY_PATH)
trying path=.//libc.so.1
trying path=/usr/java/jre/lib/sparc/libc.so.1
trying path=/usr/java/jre/lib/sparc/native_threads/libc.so.1
trying path=/usr/java/jre/lib/sparc/libc.so.1
trying path=/usr/local/lib/libc.so.1
trying path=/usr/lib/libc.so.1

Is there a way to just have that search another environmental variable? Or is there a way to just kill that and explicidly set it to something?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2004
Added on Jul 8 2004
3 comments
759 views