分发静态链接的ELF 32位二进制 - 它会在所有平台上运行? [英] Distributing a statically linked ELF 32bit Binary - Will it run on all platforms?

查看:162
本文介绍了分发静态链接的ELF 32位二进制 - 它会在所有平台上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队准备释放我们的Linux程序的第一个版本,并希望以最简单的方式这样做(用户)。

My team is ready to release the first version of our Linux program and would like to do so in the easiest possible manner (for users).

程序需要任何外部文件,无需安装,并且是静态链接。

The program needs no external files, no install, and is statically linked.

ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.15, not stripped

我的问题是这样的文件是否会在大多数Linux平台(Ubuntu的,红帽,OpenSuse当中,等等)?运行

My question is whether such a binary will run on most Linux platforms (Ubuntu, Redhat, OpenSuse, etc)?

我也有点担心它说:在GNU / Linux 2.6.15部分,这是否意味着他们需要内核2.6.15或更高?

I'm also a bit concerned about the part where it says 'for GNU/Linux 2.6.15', does this mean that they need kernel 2.6.15 or higher?

推荐答案

全静态链接程序,不推荐了。

Full statically linked programs are not recommended anymore.

从内核移动便携性层调用到基本库(记住的pthread desaster与LinuxThreads的&LT的问题;? - > NPTL线程)。

The portability layer moved from kernel calls into the basic libraries (remember the pthread desaster and the problems with LinuxThreads <-> NPTL threads?).

遵循LSB 4.0标准。信任库的存在提到那里(没有那么多的不幸),并捆绑其他所有的共享库与应用程序。有一个链接器标志 - 我认为这是-L - 在这里你可以设置其中有precedence通过共享库加载过程中的所有其他设置让你的库总是首先加载LDD路径。

Follow the LSB 4.0 standard. Trust in the existence of the libraries mentioned there (not so many unfortunately) and bundle all the other shared libraries with your application. There is a linker flag - i think it was -L - where you can set a ldd path which has precedence over all other settings during shared library loading so your libs are always loaded first.

请确保所有图书馆只调用LSB批准的API函数(或者有LSB网站上看看,看看非有多严重支持LSB API调用 - 有时你根本无法避免,他们有分布列表支持此调用)。

Make sure that all libraries only call LSB approved API functions (or have a look on the LSB website and see how serious a non supported LSB API call is - sometimes you simply can't avoid it and they have a list of Distributions that support this call).

这是为客户提供二进制可执行文件的推荐方式。它仍然吮吸的Linux相对于Windows / MacOSX的很多东西。

This is the recommended way to deliver binary executables. And it still sucks a lot on Linux compared to Windows/MacOSX.

这篇关于分发静态链接的ELF 32位二进制 - 它会在所有平台上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆