编译我的应用程序以支持GLIBC_2.19的执行
我正在与我的小组中的服务器农场合作,最新版本的LDD库是Glibc_2.19,这就是为什么获取错误“ glibc_2.29'找不到的版本”。
我无法在服务器上安装新版本。我不是管理员,远不及要求的职位,所以我需要更改程序。 那么,如何积极降级版本,以便我的程序可以在服务器上运行?
I'm working with a server farm in my group and the latest version of the ldd library is GLIBC_2.19 which is why get the error "version `GLIBC_2.29' not found".
I can not install a new version on the servers. I'm not an admin and nowhere near the position to ask for that so I need to alter my program.
So how do I actively downgrade the version so that my program can run on the server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有多种方法可以解决此问题。
选项#1:对您要支持
C的最古老的GLIBC编译应用程序,而CPP应用程序往往会在您编译时“锁定”最小支持的ABI。如果您在CentOS/Rhel/Oracle 6上编译它们,则您的应用程序应该能够在任何较新的OS上运行,因为GLIBC库是向后兼容的。
选项#2:在Docker内运行应用程序,
构建包含您应用程序的Docker映像。这样,任何可以支持Docker的系统都可以在没有任何兼容性问题的情况下运行它。
选项#3:静态编译您的应用程序,
这可能是所有选项中最复杂的。我不会对此进行详细说明,但是基本上,如果您编译了静态可执行文件,则不需要加载程序或目标主机中的任何库。这使汇编过程变得复杂,可能会在运行时造成一些问题,并且在复杂的应用程序中并不那么简单,但仍然可行。
There are multiple ways to work around this.
Option #1: Compile your application against the oldest GLIBC you want to support
C and CPP applications tend to "lock" the minimal supported ABI when you compile them. If you compile them on a CentOS/RHEL/Oracle 6, then your application should be able to run on any newer OS, because GLIBC libraries are backward compatible.
Option #2: Run your application inside a docker
Build a Docker image that contains your application. That way, any system that can support Docker can run it without any compatibility issues.
Option #3: Statically compile your application
This is probably the most complex of all options. I won't elaborate on this, but basically, if you compile a static executable, you don't need the loader or any libraries from the target host. That complicates the compilation process, might create some issues in run-time and is not as straightforward with complex application, but still doable.