[opensuse] When ldconfig is required?
I have a CMake project that does install(TARGETS foo bar baz) where foo is an executable, bar and baz are shared libraries. foo is linked to bar and baz, bar is linked to baz. The install manifest: /usr/local/bin/foo /usr/local/lib64/libbar.so.0.0.1 /usr/local/lib64/libbar.so.0 /usr/local/lib64/libbar.so /usr/local/lib64/libbaz.so However, when I run ldd on any of foo or bar, they both cannot resolve links to their just-installed dependencies (... => "not found"). This is despite /etc/ld.so.conf containing things like /usr/local/lib64. RPATH is not hardcoded for any of the library (and I want it to stay that way, since it should work that way). One thing that resolved the dependencies was running sudo ldconfig Although that helped, I am still curious 1) why running ldconfig was necessary (I thought shared libraries are resolved at runtime through loader) 2) do I need to rerun it every time I reinstall foo, bar and baz 3) do I need to rerun it every time I install new executables or libraries under /usr/local I don't know much about how shared libraries work. Maybe I don't understand something. If so, please include some relevant educational content. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Tue, 20 Aug 2019, Oleksii Vilchanskyi wrote: [..]
One thing that resolved the dependencies was running sudo ldconfig
Although that helped, I am still curious
1) why running ldconfig was necessary (I thought shared libraries are resolved at runtime through loader)
Because ld.so keeps a cache /etc/ld.so.cache, which needs to be updated whenever ...
3) do I need to rerun it every time I install new executables or libraries under /usr/local
... you install or change libraries (including /lib*, /usr/lib*). Though not sure if the ()'d is true, as those are hardcoded paths unlike /usr/local/lib* AFAIR... But you should update the cache anyway as it's faster than searching for those libs in /lib64 and /usr/lib64. 'man 8 ld.so' has a little intro, read the synopsis and the first block of the description... HTH, -dnh -- VALA: I'm gonna go crazy, and I'm taking you with me. -- Stargate SG-1 10x20 - Unending -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
David Haller
-
Oleksii Vilchanskyi