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]

Re: Using alternate glibc versions / symbol versioning of glibc


On 06/03/13 10:42, Heiko.Papenfuss@uniserv.com wrote:
> 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.
Yes, that should work.
Check out rpath if you don't know about it. You may be interested to
build your
program with that instead of specifying LD_LIBRARY_PATH every time.

> 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?
I believe so. You may not even need a different ld-linux-x86-64.so,
depending
on the changes that happened between the releases.

> 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?
We already said that a program must be able to run with a newer version
of libc,
thus running a library built for a previous libc shall be possible, too.
What you must do is to run the program with the newer libc, trying to
load two libcs
in the same process could break in all kind of mysterious ways.


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