This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using alternate glibc versions / symbol versioning of glibc


Hi all,

I have some questions related to the use of different versions of glibc in a
GNU Linux system.

This is the background: We are developping software on a Linux x86_64 server
(kernel 2.6.16) that is based on glibc 2.4 and GCC 4.1.2. We are now facing
the problem that a partner supplies us with a shared library, which we need
to use in our software and that recently has changed its dependency on glibc
from 2.4 to 2.6. The shared library is closed source. We are using the
system's GCC for development.

If the following questions have already been answered elsewhere and I just
didn't find it, please feel free to direct me to the right place(s).

My main question is:

1.) How can we continue developping our software on this system without
globally replacing the glibc 2.4 with the glibc 2.6?

While I was searching the net for answers and trying stuff by myself, a
number of additional questions occurred to me:

2.) It appears to me that glibc has properly versioned symbols (at least
since 2.4) since I did the following and it worked: I have built a glibc 2.6
on the system and installed it to a separate directory (/newglibc with
subdirectories /newglibc/lib and so on). Then I invoked the system bash with
the command line

LD_LIBRARY_PATH=/newglibc/lib:/lib64:/usr/lib64 /newglibc/lib/ld-linux-x86-64.so.2 /bin/bash

and it worked although it usually uses /lib64/libc.so.6, which is a link to
/lib64/libc-2.4.so.

3.) This impression is further supported by the fact that in /newglibc/lib/,
there is also a link libc.so.6 but pointing to libc-2.6.so, and the
observation that in other Linux systems I see a lot of different actual
versions of libc being all linked by libc.so.6. And all programs seem to be
using libc.so.6 rather than a particular version of libc.so. Hence, is it
true that I can run whatever program that uses libc.so.6 as the C library
with any version of the glibc if I take care that: (a) The version of the
glibc is not older than the version the program was built with. (b) I use
the corresponding ld-linux-x86-64.so to run the program?

4.) Also, since the above worked for me (see question #2), I am wondering if
this works for shared libraries, too. Let's say that I have a program that
uses shared libraries libone.so and libtwo.so and both libraries use
libc.so.6. But libone.so has been built in an environment where libc.so.6
pointed to glibc-2.4 and libtwo.so in another where it pointed to, e.g.,
libc-2.11.so. Will it then be possible to use both libraries in one program
and would one then need to have libc.so.6 link to a libc-2.X.so with X>=11
and the program has then to be run by the ld-linux-x86-64.so that
corresponds to the used libc-2.X.so?

Well, that is a whole lot of convoluted text and I hope somebody here can
make a sense of it. Please tell me if I am missing something important
completely or approaching this in an inadequate way.

Best regards,

Heiko


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]