如何为 Solaris 8、9、10 和 AIX 创建 GNU find 的静态二进制文件(未链接、可移植)
二进制文件(我可以从一个系统复制到另一个系统),适用于 Solaris 8、9 和 10。
我们(我的团队)正在寻找正确的方法,将 GNU find 命令编译为静态(非动态链接)、可移植 有一个好的食谱来实现这一目标吗?
我们需要这个有几个原因,但其中一个事实是,出于政治和技术原因,我们不能只是将其 pkgadd 到我们需要将其传输到的所有服务器上。它很复杂,但简而言之,我支持一个使用远程代理调用系统命令的应用程序(称为 BladeLogic Server Automation)。您可能已经看过我关于它的其他帖子,但是我们在 Solaris 上使用它附带的本机查找遇到了很多麻烦,因为它没有配备我们需要的选项(-path)。 GNU 发现是,但我们不能在任何地方都安装它(太长并且拥有服务器的客户可能会拒绝)。社区建议的其他选项最终都无法在每台服务器上 100% 地工作。
尽管未经客户批准我们无法安装任何东西(这实际上可能需要数周甚至数月的时间),但我们可以推送一个独立文件,执行它,然后根据需要将其删除。因此,如果我们能为每个 Solaris 和 AIX 平台提供一个查找二进制文件,那么我们就可以轻松修复问题。
We (my team) is searching for the proper method to compile the GNU find command as a static (not dynamically linked), portable binary (that I can copy from one system to another), for Solaris 8, 9 and 10.
Would anyone have a good recipe to achieve this?
We need this for several reasons, but among them the fact that we can't just pkgadd it to all the servers we need to transport it to for political and technical reasons. It's complicated, but to make it short, I support an application that uses remote agents to call system commands (called BladeLogic Server Automation). You may have seen my other posts about it, but we're having a lot of trouble on Solaris with the native find that comes with it because it's not equipped with the options we need (-path). The GNU find is, but we can't install it everywhere (would be too long and the customers owning the servers may plain refuse). NONE of the other options suggested by the community ended up working in 100% of cases on every server.
Although we can't install anything without customer approval (which can literally take weeks if not months), we CAN push a stand-alone file, execute it, and delete it afterwards if needed. Therefore, if we could just have a find binary for each Solaris and AIX platforms we have, we would have an easy fix.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就 Solaris 而言,只需在 Solaris 8 中编译,二进制文件就可以在 Solaris 8、9 和 10 上运行。您不应该链接静态 C 库,这不利于可移植性,而不是相反。静态 libc 甚至不是 Solaris 10 的一部分。
As far as Solaris is concerned, just compile in Solaris 8 and the binaries will work for 8, 9 and 10. You shouldn't link with the static C library, this goes against portability, not the other way around. A static libc is not even part of Solaris 10.
在我看来,findutils 包除了 libc 之外没有任何依赖项,所以我不知道你想与它静态链接什么?我希望如果您在一台 Solaris 机器上构建 find ,它应该可以在所有机器上运行。您遇到什么具体问题吗?
It seems to me that findutils package has no dependencies other than libc so I dont know what do you want to statically link with it? I would expect that if you build find on one Solaris machine it should work on all. Are there any specific problems you are encountering?