This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Using Multiple versions of glibc using LD_LIBRARY_PATH env variable.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Kangkook Jee" <aixer77 at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Tue, 30 Dec 2008 11:21:32 -0500
- Subject: Re: Using Multiple versions of glibc using LD_LIBRARY_PATH env variable.
- References: <8FE8F998-E024-4B9A-B28F-D437F743AF47@gmail.com>
On Mon, Dec 29, 2008 at 2:06 PM, Kangkook Jee <aixer77@gmail.com> wrote:
> $ export LD_LIBRARY_PATH=/tmp/lib-2.9/lib:$LD_LIBRARY_PATH
> $ echo $LD_LIBRARY_PATH
> /tmp/lib-2.9/lib
> $ /bin/ls
> Segmentation fault (core dumped)
This doesn't work because /bin/ls has a INTERP program header that
requests /lib/ld-linux.so.2 and this dynamic loader does correctly
match the C library in /tmp/lib-2.9/lib/.
It would be nicer if it didn't SIGSEGV and printed an error.
> What I did next was using 'ld-linux.so.2' loader and it could exeute the
> command.
>
> $/tmp/lib-2.9/lib/ld-linux.so.2 --library-path /tmp/lib-2.9/lib /bin/ls
This is the correct way to load the application with an alternate libc.
> But I still want to find cleaner solution to have multiple versions of glic
> in a single machine. Can anyone help me with this?
Replace /lib/ld-linux.so.2 with an application that checks an
environment variable and execs the right dynamic loader with the
correct options.
Cheers,
Carlos.