[Bug 235780] New: binaries cant find libs in /usr/local/lib
https://bugzilla.novell.com/show_bug.cgi?id=235780 Summary: binaries cant find libs in /usr/local/lib Product: openSUSE 10.2 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Minor Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: spicedham@internode.on.net QAContact: qa@suse.de It seems that lconfig is set to look in /usr/local/lib (via /etc/ld.so.conf) but binaries can't find libs installed there. Oversight in setting environmental variables? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 andreas.hanke@gmx-topmail.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.hanke@gmx-topmail.de Status|NEW |NEEDINFO Info Provider| |spicedham@internode.on.net ------- Comment #1 from andreas.hanke@gmx-topmail.de 2007-01-17 07:14 MST ------- Can you be a bit more specific, please? What architecture (i586, x86_64, ...)? What exactly are you doing, and in which order? You are aware that you have to run /sbin/ldconfig before the dynamic linker can find newly installed libraries there? Why did you report this in the "Development" component? Are you talking about the run-time linker or the link editor? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 ------- Comment #2 from spicedham@internode.on.net 2007-01-17 08:12 MST ------- (be gentle - first bug report) I'm on arch i586, if I configure, make and make install an app that puts its binary into /usr/local/bin and its libs into /usr/local/lib the app can be run from the command line and the system finds it fine in the /usr/local/bin path but the app can't find the libs in /usr/local/lib. When I manually copied the libs to /usr/lib it found them okay. The above is all without invoking ldconfig at all. I mentioned ldconfig only because it's setup to look there. If I had to run ldconfig to allow the binary to find libs in /usr/local/lib why did it work without running ldconfig and copying the libs to /usr/lib? I reported it to "Development" possibly out of ignorance. I was using packages that were installed via yast and termed "Development" (ie compilers, XYZ-devel.rpms and so on) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 ------- Comment #3 from andreas.hanke@gmx-topmail.de 2007-01-17 08:16 MST ------- Does it work after running /sbin/ldconfig? What I mean is: You install a library to /usr/local/lib, and a binary to /usr/local/bin. You do not yet run /sbin/ldconfig. The binary doesn't find the library. Then you run /sbin/ldconfig. Does it work now, after running /sbin/ldconfig? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 ------- Comment #4 from spicedham@internode.on.net 2007-01-17 09:16 MST ------- Okay I do not have a new package to test this on but; I deleted all the files I copied into /usr/lib. I previously ran ldconfig and the binary seems to be finding the libs now okay. The question still remains; before I ran ldconfig the libs were being found in /usr/lib okay but not /usr/local/lib/ - is this a bug or must we run the linker each time we add libs outside of /usr/lib ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 ------- Comment #5 from andreas.hanke@gmx-topmail.de 2007-01-17 09:35 MST ------- Can you try to answer the question in comment 3 as exactly as possible? You can remove some stuff from /usr/local/lib, run /sbin/ldconfig to clean up everything, then reinstall them and do the tests. To give you some information: The system keeps a "cache" of all shared libraries in /etc/ld.so.cache, to speed up program startup. This behaviour is configurable in /etc/ld.so.conf. The speedup is achieved by storing the path to the libraries, so that the linker doesn't have to go through all search paths each time you start a program. If you run /sbin/ldconfig, you'll notice that it needs some time to run; this is the time it saves on each startup of a program. This is very nice, but also means that /sbin/ldconfig _must_ be run after installation, update or removal of any shared libraries. Sometimes it works even without the /sbin/ldconfig call, but this is pure coincidence and doesn't have anything to do with whether the library is in /usr/lib or /usr/local/lib. Do more tests and you'll see that without calling /sbin/ldconfig, it will sometimes fail even for /usr/lib. Now, all I need to know is whether everything works after running /sbin/ldconfig. If it does, it's not a bug because this is the designed behaviour. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 ------- Comment #6 from spicedham@internode.on.net 2007-01-17 12:38 MST ------- Okay, apparently the fact that I've never had to run ldconfig before to get something I compiled to work has been amazing luck on my part. The fact that no "./configure \ make \ make install" instructions that I've read have ever mentioned this fourth step is perplexing but I'm willing to accept that it's standard procedure. To clarify the above again; Libs just dropped into /usr/local/lib don't work. Libs then copied into /usr/lib do work _without_ running ldconfig. Either way running ldconfig afterwards does work. Just as a final test I've done what you suggested (I think - I'm fairly clueless really) * I removed all trace of the libs from /usr/lib * I moved the /usr/local/lib directory to /usr/local/X-lib so it could not be found by ldconfig and replaced it by making a new (empty) directory /usr/local/lib * I ran ldconfig and it checked everything * I tried to run the binary and it could not find the lib (as expected) * I copied the /usr/local/X-lib contents into /usr/lib * NOTE: I didn't run ldconfig here * I tried to run the binary and .. IT WORKED lol * I again removed the libs from /usr/lib * I ran ldconfig * I tried to run the binary - it couldn't find the library * I moved the /usr/local/X-lib back to /usr/local/lib * Ran binary - no library found * Ran ldconfig (like I should have done in the first place) * Ran binary - it WORKS. (In all of the above I made sure that there was no running processes still) So as you can see, if these libs are in /usr/lib they seem to just work, but if they are in /usr/local/lib then they need to be linked/cached with ldconfig. *blinks* -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 andreas.hanke@gmx-topmail.de changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|pth@novell.com |bnc-team-screening@forge.provo.novell.com Status|NEEDINFO |NEW Component|Development |Basesystem Info Provider|spicedham@internode.on.net | ------- Comment #7 from andreas.hanke@gmx-topmail.de 2007-01-17 12:59 MST ------- Maybe I'm wrong here or glibc changed its behaviour, but running ldconfig after shared library installation has always been mandatory, where "always" means "since ldconfig exists". If you don't like to run it, you can create a file /etc/profile.local with export LD_LIBRARY_PATH=/usr/local/lib in it, then after the next login it will always work without ldconfig. But that doesn't work with setuid binaries or sudo and is therefore not a good default. The only unexpected thing here is that it works for /usr/lib without ldconfig. If you want to reassign it: This is about the glibc package. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 ------- Comment #8 from andreas.hanke@gmx-topmail.de 2007-01-17 13:12 MST ------- http://www.faqts.com/knowledge_base/view.phtml/aid/361 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 spicedham@internode.on.net changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Comment #9 from spicedham@internode.on.net 2007-01-17 14:22 MST ------- Okay, thanks for your info. I guess this isn't a bug as such. Still a bit weirded out that this step isn't included in most how tos and so on. For example google hits for "configure make install" about 27,400,000 And for configure make install ldconfig about 438,000 Crazy world hey? lol I think I'll just set this as resolved:invalid and get on with my life. lol -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=235780 mmarek@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mmarek@novell.com ------- Comment #10 from mmarek@novell.com 2007-01-17 15:49 MST ------- (In reply to comment #6)
So as you can see, if these libs are in /usr/lib they seem to just work, but if they are in /usr/local/lib then they need to be linked/cached with ldconfig.
That's because the run-time linker searches /%_lib and /usr/%_lib as a fallback, but not /usr/local/%_lib. It also doesn't use /etc/ld.so.conf, this file is only read by the ldconfig program. See ld.so(8). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com