在旧系统上运行的较新 gcc 二进制文件
我有一个用 gcc 4.4.0 编译的二进制文件,并尝试在没有 gcc 4.4.0 的旧系统上运行它。这不起作用。错误并不是找不到符号,而是它无法正确运行并挂起。系统之间的差异是 CentOS 5.5 与 5.2,gcc 4.4.0 与 3.4.6。
在不安装 gcc 4.4.0 的情况下,我该怎么做才能让它在该系统上运行?是否有我们可以放置的运行时库?简单地复制依赖项并设置库路径似乎不起作用。
该二进制文件需要 gcc 4.4.0 的功能。
I have a binary compiled with gcc 4.4.0 and am trying to run it on an older system, which does not have gcc 4.4.0. It doesn't work. The error is not that it can't find a symbol, but it just doesn't run correctly and hangs. The differences between the systems are CentOS 5.5 vs 5.2, and gcc 4.4.0 vs 3.4.6.
What can I do to get it running on that system without installing gcc 4.4.0? Are there run-time libraries we can put on it? Simply copying the dependecies over and setting the library path does not appear work.
The binary requires features of gcc 4.4.0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最近遇到了必须这样做的情况。我的解决方案是将可执行文件编译为静态链接的应用程序,因此我的应用程序和所需的库之间不存在兼容性问题。
I've run into a situation where I had to do this recently. My solution was to compile the executable as a statically linked application so there was no issues with compatibility between my application and needed libraries.
如果您要进行编译,请在具有旧版 GLIBC 库的计算机上进行。
我在 VirtualBox 中设置了 Debian,它在编译 Apache、MySQL 和 PHP 时工作完美。
If you're compiling, do it on a machine with older GLIBC libraries.
I've set up a Debian in VirtualBox, that's works flawless when compiling Apache, MySQL and PHP.