On 25 Mar 2002, Oleg Goldshmidt wrote:

> I solved my immediate problem by installpkging the development tools
> from slackware-8.0 over the original system (got OK from the vendor).
> However, I am still curious about peace and co-existence of various
> glibc's, so if anyone has any clue, do letme know.

actually, this is easier then it sounds. all you need to do is make sure
processes linked with different libraries, look for them in different
directories. this can be done either during compile (actually link) time,
with the '-rpath' switch of gnu ld, or during run time, with
LD_LIBRARY_PATH.  you should just realize that the libraries that the
_compiler_ depends on don't have to be the same as the libraries the
compiler linkes the _resulting binary_ with.

when i have a single binary i want to run with different libraries
(usually tihs happens when i have a binary that was linked against an
older libc then the one i have), i replace it with a shell script that
sets LD_LIBRARY_PATH, and then runs the real binary. for example, to run
acrobat reader on this redhat 6.2 (acroread was linked with libc5, not
libc6):

#!/bin/sh
LD_LIBRARY_PATH=/usr/i486-libc5-linux/lib:/usr/local/acrobat3/Reader/intellinux/lib
export LD_LIBRARY_PATH
#ldd /usr/local/Acrobat4/Reader/intellinux/bin/acroread
/usr/local/acrobat3/bin/acroread $*

the 'ldd' command is there to be used when i want to check which libraries
will be actually linked with the application after modifying
LD_LIBRARY_PATH.

if you want to use a compiler that uses a newer libc, but have the
ersulting application linked against a different libc, you may need to run
the compiler with a modified LD_LIBRARY_PATH, but on the compile line,
give it switches telling it to use a different c library (using
combinations of -L, and possibly using --nostdc and specifying all the
libraries and stubs on the link line, including -llibc, -lm and the
obligatory /usr/lib/crt1.o or /usr/lib/gcrt1.o - stracing a regular
compiler will show you which libraries and stubs it links applications
with, by default.

--
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to