[lug] Coexistence of more than a version of an API

karheng at softhome.net karheng at softhome.net
Fri Jul 9 03:07:24 MDT 2004


What're the ways in which 2 or more versions
of an API coexist in a Linux system?.. & (especially)
how does it work? (as in when apps are loaded, requiring
the proper version of the library to load as well) 

Offhand, some of the things I've come across are packages
that have names like compat in them..
Think I've seen this before with gtk & glib..
Or it was glibc...
.. and then there're some that just requires a replace. 

The particular scenario I'm interested in is: 

Lets say I've got glibc 1.8, 2.0, 2.2 all installed in
my system.
I'd probably have files something like this: 

libglibc-1.so -> libglibc-1.8.so
libglibc-2.so -> libglibc-2.2.so
libglibc.so -> libglibc-2.so 

I then compile & link a program called foo, & it
currently links to libglibc.so, which is libglibc-2.so,
which is libglibc-2.2.so..
(perhaps in this case, foo might actually specifically
need glibc-2.2.so as it works around a bug only
applicable to this version of glibc..) 

This is nice & dandy as long as the system stays the same. 

If I then install say libglibc-2.4.so... & have libglibc-2.so &
libglibc.so as sym links to libglibc-2.4.so, how does my program,
foo, know which .so file to link to? (or in other words,
how does ld.so handle this correctly?) 

Does it depend on what I link with during build time?
ie: -lglibc, or -lglibc-2.4 or -lglibc-2 

Thanks in advance.. 



More information about the LUG mailing list