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 Multiple versions of glibc using LD_LIBRARY_PATH env variable.


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.


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