Hi,
I have an application with the following setup:
#1 executable cct build with -rpath /my/special/dir
#2 /my/special/dir has shared library libmyspecial.so as LOCAL-SOFT-LINK
to libmyspecial.so.4.0
problem dlopen /my/special/dir/libmyspecial.so fails with
libmyspecial.so.4.0 not found
start LD_DEBUG=all cct shows that -rpath is NOT used :
7205: file=libmyspecial.so.4.0 [0]; needed by
/my/special/dir/libtclreadline.so [0]
7205: find library=libmyspecial.so.4.0 [0]; searching
7205: search cache=/etc/ld.so.cache
7205: search
path=/lib/tls/i686/sse2:/lib/tls/i686:/lib/tls/sse2:/lib/tls:/lib/i686/sse2:/lib/i686:/lib/sse2:/lib:/usr/lib/tls/i686/sse2:/usr/lib/tls/i686:/usr/lib/tls/sse2:/usr/lib/tls:/usr/lib/i686/sse2:/usr/lib/i686:/usr/lib/sse2:/usr/lib
(system search path)
7205: trying file=/lib/tls/i686/sse2/libmyspecial.so.4.0
7205: trying file=/lib/tls/i686/libmyspecial.so.4.0
7205: trying file=/lib/tls/sse2/libmyspecial.so.4.0
7205: trying file=/lib/tls/libmyspecial.so.4.0
7205: trying file=/lib/i686/sse2/libmyspecial.so.4.0
7205: trying file=/lib/i686/libmyspecial.so.4.0
7205: trying file=/lib/sse2/libmyspecial.so.4.0
7205: trying file=/lib/libmyspecial.so.4.0
7205: trying file=/usr/lib/tls/i686/sse2/libmyspecial.so.4.0
7205: trying file=/usr/lib/tls/i686/libmyspecial.so.4.0
7205: trying file=/usr/lib/tls/sse2/libmyspecial.so.4.0
7205: trying file=/usr/lib/tls/libmyspecial.so.4.0
7205: trying file=/usr/lib/i686/sse2/libmyspecial.so.4.0
7205: trying file=/usr/lib/i686/libmyspecial.so.4.0
7205: trying file=/usr/lib/sse2/libmyspecial.so.4.0
7205: trying file=/usr/lib/libmyspecial.so.4.0
If I add /my/special/dir to LD_LIBRARY_PATH it is working but this is
NOT done by default
deeper analyses: ls option -rpath add an DT_RUNPATH section and man page
say:
#1 o Using the directories specified in the DT_RPATH dynamic section
attribute of the binary if present and DT_RUNPATH attribute does not
exist. Use of DT_RPATH is deprecated.
#2 o Using the directories specified in the DT_RUNPATH dynamic section
attribute of the binary if present. Such directories are searched only
to find those objects required by DT_NEEDED (direct dependencies)
entries and do not apply to those
objects' children, which must themselves have their own
DT_RUNPATH entries. This is unlike DT_RPATH, which is applied to
searches for all children in the dependency tree.
info #2 says:
#1 flag DT_NEEDED ? is required ( I this this are the DIRECT
dependencies listed by ldd and NOT the dlopen one)
#2 object children ? ( process children? OR SOFT-LIBNK children?) as NOT
searched by DT_RUNPATH
conclusion
#1 As I observed the case #2 says the linker -rpath option is NOT used
for dlopen files
#2 DT_RPATH would probably do the job but gnu ld does NOT set this and
it is deprecated also.
Question: WHAT I have to do with cct to find the library WITHOUT
modify/use the LD_LIBRARY_PATH and without
modify the ld.so system files?