in reply to How to setup the DynaLoader in a dynamically loaded perl?
When linking with --rpath=. the shared library must be in the current directory. What I would want is that the shared library is looked up there where the application is.man 8 ld.so:
The dynamic linker understands certain token strings in an rpath specification (DT_RPATH or DT_RUNPATH). Those strings are substituted as follows:
$ORIGIN (or equivalently ${ORIGIN})
This expands to the directory containing the program or shared object. Thus, an application located in somedir/app could be compiled with
so that it finds an associated shared object in somedir/lib no matter where somedir is located in the directory hierarchy.gcc -Wl,-rpath,'$ORIGIN/../lib'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to setup the DynaLoader in a dynamically loaded perl?
by sciurius (Beadle) on May 06, 2020 at 12:15 UTC |