This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu 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]

Re: installing glibc-2.1 as normal user


>>>>> Kasper Peeters writes:

 > I am trying to install glibc-2.1 on a glibc-2.0 based machine as a
 > normal user (I am not root on this machine and the sysadmins do not
 > want modern stuff). 

 > This, apparently, leads to a problem. Even though glibc-2.1 can be
 > used to run glibc-2.0, it seems that you _have_ to use the 2.1 dynamic
 > loader ld-2.1.so. That is fine if I just want to run a binary, since I
 > can just do

 >    ~/lib/ld-2.1.so [programname]

 > and it will work. But it is annoying, and it also means that I cannot
 > use scripts which are started through `#!/bin/...' since 

 >    ~/lib/ld-2.1.so [script]

 > then has to be run as

 >    ~/lib/ld-2.1.so [interpreter] [script]

 > (the dynamic loader does not like scripts) and I have to figure out
 > the name of the interpreter myself by peeking at the script.


 > I guess I'm asking for the impossible here, but is there a way to
 > separate the _dl_* stuff in ld-2.1.so into a separate library such
 > that I can use the glibc-2.0 dynamic loader with the 2.1 libraries?
 > Or any other smart trick that makes the kernel use my glibc-2.1
 > dynamic loader instead of the /lib/ld-linux-2.so one?

You can't mix dynamic linker and libc from different versions - no
chance.

You can compile against a locally installed (here with
--prefix=/usr/glibc/glibc-2.1) glibc with e.g.:
#!/bin/sh
gcc  $* \
-L /usr/glibc/glibc-2.1/lib -I /usr/glibc/glibc-2.1/include \
-Wl,--rpath=/usr/glibc/glibc-2.1/lib \
-Wl,--dynamic-linker=/usr/glibc/glibc-2.1/lib/ld-linux.so.2 \
-g

Since you mentioned rpath and dynamic linker, the binaries will run
without any additional setup (no need for LD_LIBRARY_PATH!).

Andreas
-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

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