生锈的标志是“链接自由式的”与货物交叉相比?

发布于 2025-02-04 20:37:22 字数 239 浏览 3 评论 0原文

如何使用 cross ,被描述为

“零设置”交叉汇编和锈蚀箱的“交叉测试”

链接>链接固定的选项?

How does link-self-contained work with cross, which is described as

“Zero setup” cross compilation and “cross testing” of Rust crates

Versus the link-self-contained option of rustc?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无声无音无过去 2025-02-11 20:37:22

这些工具都有不同的目标,因此您不会选择一个目标。

链接 - 封装选择构建一个自包含的可执行文件,该可执行文件将拥有在任何正确体系结构的系统上运行所需的一切。这包括可执行文件使用的所有库。替代方案(默认值)将用于可执行文件,以查找运行时安装在系统上的库。查看动态与静态库,以了解有关此信息的更多信息。

Cross可以使工具更容易交叉编译和测试不同的体系结构。很多时候,运行时环境将拥有最少的资源,并且在开发过程中不理想。使用交叉编译,以便可以在具有更多资源的机器上进行开发。设置交叉编译器通常需要一些时间来手动进行操作,因此该工具旨在使该过程变得更加简单。

至于它们如何一起工作,理想情况下,它们在使用两者时都会以相同的方式执行。如果您交叉编译ARM架构并设置链接链接标志,那么您最终将获得一个自包装的二进制文件,该二进制可以使用正确的ARM体系结构移至任何系统并拥有一切它需要运行。

These tools both have different goals so they aren't something that you would choose one over the other.

link-self-contained is choosing to build a self contained executable that will have everything it needs to run on any system that is the correct architecture. This includes any libraries that are used by the executable. The alternative (default) would be for the executable to look for libraries that are installed on the system when it is ran. Take a look into dynamic vs static libraries for more information on this.

cross is tooling to make it easier to cross compile and test for different architectures. Many times the runtime environment will have minimal resources and is not ideal to work on during the development process. Cross compiling is used so that development can be done on a machine with more resources. Setting up a cross compiler usually takes some time to do manually and so this tooling aims to make that process much simpler.

As far as how these work together, ideally they would perform the same way when both are being used. If you cross compile for an arm architecture and set the link-self-contained flag, then you will end up with a self contained binary that can be moved to any system using the correct arm architecture and have everything it needs to run.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文