Linux Library

Posted on: Thu, 10/06/2005 - 13:41 By: dae

the stupidity attemp

I have to set up something.. (linux box, kind of..) but there are some problems about shared library. I never understand nething of shared lib, except that it ends with .so. After a few googling around, here are some useful links.

http://www.tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html http://www.visi.com/~barr/ldpath.html

Here are some new knowledges for me

  • shared libraries are stored in /usr/lib or /usr/local/lib with a few exception for the very important ones used while booting which are stored at /lib.
  • the number behind .so (e.g., libvorbis.so.3.0.1) is the major and minor version of the library. Usually, the actual file is fully qualified and symlinked to the less clarity name (e.g., libvorbis.so.3.0 and libvorbis.so.3 and libvorbis.so are symlinked to the libvorbis.so.3.0.1).
  • At run-time, a binary search amongst the predefined standard library path. Unlike MS, the current directory is not the standard lib path. To add an additional directory to the search path, use LD_LIBRARY_PATH env. variable. This method is not prefered as discussed in the above link.
  • To add new library to the system, just copy the original one and then use ldconfig to create the appropriate symlink (according to the version of the library)

For more information, don't forget to read the provided link.

and now the light has shined on my

The fact is, the library that is needed to be upgraded is glibc. Almost everything, (i repeat almost everything) rely on this library. I can upgrade, but the most part of my box would be, well, virtually useless. I tried using LD_LIBRARY_PATH with the new glibc, the result is that i cannot even ls, luckily, i can reset the variable so that my box is back to life.

After googling (again), a good recommendation about upgrading glibc is

Are you sure that you want to try this? Just about everything on your system is linked against Glibc and as such an upgrade of that set of libraries has the potential of breaking many, if not most, of the system components. Personally I'd only do this by an upgrade of the OS that includes Glibc 2.3

Well, I will try other distro then....