Posix: Add default SONAME/install_name for dynamic libraries
...
Setting it to the filename (ELF) or `@rpath/<file name>` (Mach-O).
This seems to be required in order to use the libraries copied to
the output directory of dependees - either by setting the
LD_LIBRARY_PATH env var when starting the executable, or baking a
RUNPATH into the executable (e.g., via `patchelf --set-rpath` for
deployment).
Otherwise the loader tries to load the library from the original
location specified in the linking cmdline, which is some
`<path to dep pkg>/.dub/…` path (and apparently potentially
relative, and thus even more brittle). For ELF, I would assume
that all SONAME + DT_NEEDED entries (of executable + all .so libs)
would need to be post-processed to enable loading the libs from the
executable's directory (well, any non-original location).
Martin Kinkelin
authored
on 17 Aug 2022
Mathias LANG
committed
on 30 Aug 2022