0
votes

I have a build system which generates binaries with a hardcoded RPATH. If the required package isn't on the current machine, I have a package manager which will download & untar the missing library.

Can I hook the linux dynamic linker so I can run my package manager if it fails to find a library? And then rerun the dynamic linker once the library is available?

1
Yes, but why isn't your package manager handling the dependencies?Ignacio Vazquez-Abrams
The binary has been copied to a different machine than the machine it was built on. I can manually rerun the package manager to get the packages, but I wanted it to work automatically via the dynamic linker.ACyclic
Why have you copied the binary instead of the generated package?Ignacio Vazquez-Abrams
I don't think we're talking about the same thing. My "package manager" installs 3rd party packages to the local system, it's not like tar, it doesn't create a package containing the binary. Once on the destination machine, the information the package manager needs is in the binary's RPATH.ACyclic

1 Answers

0
votes

use -Wl,--dynamic-linker=file (see man ld)

But overloading the dynamic linker will only work for loading executables, not for shared libraries.