为较旧的 glibc 构建 [英] Build for older glibc
问题描述
我正在构建 32 位 C++ 库,它将在现代 Ubuntu 机器上的旧系统上运行.应用程序在 Ubuntu 上运行良好,但是当我移动到旧的 Centos 6.9 机器时出现错误:
I'm building 32 bit c++ library that will run on old system on modern Ubuntu machine. Application works fine on Ubuntu, but when I moved to old Centos 6.9 machine I got error:
Failed to open my lib: /usr/lib/libstdc++.so.6: version 'GLIBCXX_3.4.21' not found (required by /home/aaa/bbb/libme.so)
如何解决这个问题?如何为较旧的 glibc 构建?
How to solve this problem? How to build for older glibc?
推荐答案
告诉编译器和链接器使用旧符号的唯一方法版本是通过使用链接器脚本.然而,这需要你为每个符号指定版本,这是一个可撤销的任务.
The only way to tell the compiler and linker to use older symbol versions is by using linker scripts. However, this requires you to specify the version for each and every symbol, which is an undoable task.
您可以使用Holy Build Box
Holy Build Box 解决了 glibc 符号问题,提供了一个包含旧版本的严格控制的构建环境glibc.
Holy Build Box solves the glibc symbol problem by providing a tightly-controlled build environment that contains an old version of glibc.
这篇关于为较旧的 glibc 构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!