rust 交叉编译,从 windows 编译到 Linux ,卡住不动

2022-07-29 17:47:56 +08:00
 proxytoworld

.cargo/config

[target.x86_64-unknown-linux-musl]
linker = "rust-lld"

执行命令 cargo build --target x86_64-unknown-linux-musl 如下图,卡住不动了,有没有老哥知道怎么搞

rustup show 结果:

PS > rustup show
Default host: x86_64-pc-windows-gnu
rustup home:  C:\Users\test\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-gnu (default)
stable-x86_64-pc-windows-msvc

installed targets for active toolchain
--------------------------------------

x86_64-pc-windows-gnu
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

stable-x86_64-pc-windows-gnu (default)
rustc 1.62.1 (e092d0b6b 2022-07-16)


1228 次点击
所在节点    问与答
3 条回复
hangbale
2022-07-29 18:25:51 +08:00
用 GitHub Action 多环境编译
elechi
2022-08-01 15:20:24 +08:00
没用过 rust ,看 atcive toolchain 下没有 linux 的 toolchain
ilanyu
2023-02-26 20:21:18 +08:00
我也这样,x86_64-pc-windows-gnu 改为用 x86_64-pc-windows-msvc 后好了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/869513

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX