Solaris 上的静态代码?
问:
- 为什么静态库
/usr/lib/*.a
从 Solaris 10 中删除? - 那么不可能生成静态链接对象吗?
- 动态链接编译是唯一的选择吗?
Question:
- Why were static libraries
/usr/lib/*.a
dropped from Solaris 10? - So it is NOT possible to generate statically-linked object?
- Dynamically-linked compilation, is the only option?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果将正确的标志传递给链接器,则可以创建静态库或应用程序。 然而,你为什么要这么做呢? 静态库很难提供修复。
If you pass the right flags to the linker, then you can create a static library or application. However, why would you want to? Static libraries are a pain to provide fixes for.
这是一个明智的决定。 静态链接的想法并不能很好地发挥作用。 这就是为什么 LSB(Linux Standard Base)项目也禁止静态链接。 在过去的二十年里,兼容性从系统调用发展到了更高的水平。
It's a wise decision. The static linking idea does not really work well. Thats why LSB (Linux Standard Base) Project also forbids static linking. Compatibility moved away from system calls to a higher level in the last two decades.
不能说我曾经去找过它们,但你检查过“附加选项”(或他们所说的任何东西)CD/DVD 吗? 我记得它还有其他随机“丢失”的东西......
Can't say I've ever gone looking for them, but did you check the "additional options" (or whatever they call it) CD/DVD? I remember it had other random "missing" things...
您仍然可以创建自己的 *.a 库并链接到它们,但系统库将始终动态链接。
请参阅:来自 blogs.oracle.com 的这篇文章
You can still create your own *.a libraries and link to them, but the system libraries will always be dynamically linked.
See: this post from blogs.oracle.com