简体   繁体   English

如何安装多个版本的glibc?

[英]How to install multiple versions of glibc?

I have a glibc version 2.19 on ubuntu installed. 我在ubuntu上安装了glibc版本2.19。 I would also like to install 2.3.4 version along with 2.19 on my machine. 我还想在我的计算机上安装2.3.4版本和2.19版本。

By default, all the program should use 2.19 but only specific program should use 2.3.4. 默认情况下,所有程序应使用2.19,但只有特定程序应使用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.3.4,例如/usr/glibc2.3.4?
  2. How should I specify particular program to use the 2.3.4 version? 如何指定特定程序以使用2.3.4版本?
  1. Extract the 2nd version inside /opt . 提取/opt内的第二个版本。
  2. Use LD_LIBRARY_PATH to look for libraries inside /opt first. 使用LD_LIBRARY_PATH首先在/opt查找库。

If you just want the dynamic libraries from the other version of glibc you can simply use LD_LIBRARY_PATH. 如果只需要其他版本的glibc中的动态库,则只需使用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). 您可能还希望编译其他版本的glibc,以使所有硬编码路径都指向安装目录,以加载数据文件和插件(用于NSS和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. 使用--prefix=/usr/glibc2.3.4还将动态加载程序的名称设置为/usr/glibc2.3.4/lib/ld-linux.so.2 (或类似的值,具体取决于您的体系结构),并将其进行硬编码。进入与之链接的每个程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM