15

I have a glibc version 2.19 on ubuntu installed. I would also like to install 2.3.4 version along with 2.19 on my machine.

By default, all the program should use 2.19 but only specific program should use 2.3.4.

The two questions are:

  1. How should I install the 2.3.4 at particular location, say /usr/glibc2.3.4?
  2. How should I specify particular program to use the 2.3.4 version?
Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
UnSat
  • 1,347
  • 2
  • 14
  • 28
  • 3
    Visit this: http://stackoverflow.com/questions/847179/multiple-glibc-libraries-on-a-single-host, might help you – Gaurav Dave Feb 01 '15 at 04:48
  • 10
    Whoever flagged as "general computing help" needs to re-read the site's guidelines on what is off/on topic. This is asking about glibc - a programming library, which makes the question fall right into **on topic**. – Qix - MONICA WAS MISTREATED Feb 01 '15 at 04:55
  • @GauravDave: Thanks for the pointer. I had seen the post you referred to before I posted the question. It talks about how to link a exe with the non-default version of glibc. This partly answer my second question but not entirely as I have 100 of exes which are build through that many makefiles. As per the solution at the referred post, I will have to modify those many makefiles to specify --rpath and --dynamic-linker option. I would like to know if better solution exists. Also the first question is not answered i.e. how to install different version of the glibc to coexist with default one. – UnSat Feb 02 '15 at 16:01
  • I once tried to install two versions of glibc (exactly, tried to install a newer version of glibc from Ubunto to my centos which came with lower version glibc. ) and I failed to do that. in my case, I solved the problem by I guess changing some configuration during the build that required newer version of glibc. I forgot the exact case. sorry. – Chan Kim Apr 29 '15 at 01:20

2 Answers2

3
  1. Extract the 2nd version inside /opt.
  2. Use LD_LIBRARY_PATH to look for libraries inside /opt first.
z3ntu
  • 190
  • 7
  • 20
Pointer
  • 627
  • 2
  • 8
  • 19
3

If you just want the dynamic libraries from the other version of glibc you can simply use LD_LIBRARY_PATH. But if you want to fully use the other version you need to compile against the other version to get the static parts. And you might want to compile the other version of glibc as well to get all the hardcoded paths to point to your installation directory for loading datafiles and plugins (for NSS and gconv). Using --prefix=/usr/glibc2.3.4 will also set the soname of the dynamic loader to /usr/glibc2.3.4/lib/ld-linux.so.2 (or something similar depending on your architecture) which will be hardcoded into every program linked against it.

Fabel
  • 1,711
  • 14
  • 36