关于Linux的二进制兼容性 [英] About the binary compatibility of Linux
问题描述
如果我得到了一些由Ubuntu构建的C ++代码,比如说,Ubuntu上的GCC 4.8,代码没有GUI /接口,只调用标准Linux库,那么二进制文件可以在RHEL 5/6上运行, ?
If I get some C++ code built by, lets say, GCC 4.8 on Ubuntu, the code has no GUI/interface, only call standard Linux libraries, then can the binary run on RHEL 5/6, with much older GCC flawlessly?
推荐答案
通常情况下它不行。它会抱怨libc太旧,比如一个。
Normally it can't. It will complain about libc being too old, for one.
如果您静态链接libstdc ++并小心避免更新的glibc功能,那么您可能可以避开它。后者并不总是可能的。静态链接libc不被官方支持,可能适用于您。
If you statically link with libstdc++ and carefully avoid newer glibc features, you may be able to get away with it. The latter is not always possible though. Static linking with libc is not officially supported and may work or not work for you.
这篇关于关于Linux的二进制兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!