using alternative glibc
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > using alternative glibc




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    using alternative glibc  
Andrei Voropaev


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11:19 PM

Hi!

Sorry if this question is not for this group.

I have installed newer glibc version into alternative directory
/usr/local/glibc. Now I would like to run executable compiled against
that version. But when I try to start it I get errors like

/bin/sh: /lib/ld-linux.so.2: version `GLIBC_PRIVATE' not found (required
by /usr/local/glibc/lib/libdl.so.2)

I guess the problem is with that '/lib/ld-linux.so.2' this is loader for
my current version of glibc. The newer loader is at /usr/local/glibc/lib
directory. Is there any way that I can force that executable to use my
"alternative" glibc?

Thank you

Andrei





[ Post a follow-up to this message ]



    Re: using alternative glibc  
Igmar Palsenberg


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-04 11:19 PM

Andrei Voropaev wrote:

> I have installed newer glibc version into alternative directory
> /usr/local/glibc. Now I would like to run executable compiled against
> that version. But when I try to start it I get errors like
>
> /bin/sh: /lib/ld-linux.so.2: version `GLIBC_PRIVATE' not found (required
> by /usr/local/glibc/lib/libdl.so.2)
>
> I guess the problem is with that '/lib/ld-linux.so.2' this is loader for
> my current version of glibc. The newer loader is at /usr/local/glibc/lib
> directory. Is there any way that I can force that executable to use my
> "alternative" glibc?

The path to ld-linux.so.* is hard-coded at link-time. You need to hack
the gcc linker script to make it use the other linker.

The script itself is in /usr/lib/gcc-lib/<arch>/<version>/specs

You might as in a gcc group on how to hack it, I won't touch it 


Igmar





[ Post a follow-up to this message ]



    Re: using alternative glibc  
Paul Pluzhnikov


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-29-04 07:52 AM

Igmar Palsenberg <igmar@non-existant.local> writes:

> The path to ld-linux.so.* is hard-coded at link-time.

True.

> You need to hack
> the gcc linker script to make it use the other linker.

False. Simple command line option:

-Wl,-dynamic-linker=/usr/local/glibc/lib/ld-linux.so.2

is sufficient to override the default dynamic interpreter.

One could also run existing executables without relinking this way:

/usr/local/glibc/lib/ld-linux.so.2 --library-path /usr/local/glibc/lib ./a.o
ut

Finally, take a look here:

http://www.bitwagon.com/rtldi/rtldi.html

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.





[ Post a follow-up to this message ]



    Re: using alternative glibc  
Andrei Voropaev


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-29-04 12:52 PM

On 2004-07-29, Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> wrote:
> Igmar Palsenberg <igmar@non-existant.local> writes:
> 
>
> True.
> 
>
> False. Simple command line option:
>
>   -Wl,-dynamic-linker=/usr/local/glibc/lib/ld-linux.so.2
>
> is sufficient to override the default dynamic interpreter.
>
> One could also run existing executables without relinking this way:
>
>   /usr/local/glibc/lib/ld-linux.so.2 --library-path /usr/local/glibc/lib .
/a.out
>
> Finally, take a look here:
>
> http://www.bitwagon.com/rtldi/rtldi.html

Cool. This is what I need. Simple loading with my own ld-linux.so.2 does
not work, because that executable invokes some external programs that
are compiled against old library and this failes because they find new
library in the library-path. I'll try out rtldi

Andrei





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:21 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register