rustup target list --toolchain nightly
的输出不包含x86_64-apple-ios-macabi
,即使它位于the Rust master branch上的src/librustc_target
中。
如何为Mac Catalyst / x86_64-apple-ios-macabi
进行构建?
rustup target list --toolchain nightly
的输出不包含x86_64-apple-ios-macabi
,即使它位于the Rust master branch上的src/librustc_target
中。
如何为Mac Catalyst / x86_64-apple-ios-macabi
进行构建?
x86_64-apple-ios-macabi
目标可在每晚(5c5b8afd8 2019-11-16)编译器上使用。仅仅因为有目标并不意味着标准库和朋友就可以编译或可以锈蚀:
% rustc +nightly --print target-list | grep macabi
x86_64-apple-ios-macabi
Rust有一个tier system(这是a proposed RFC的主题)。这个目标太新了,甚至没有在等级列表中列出,但毫无疑问将成为等级3。2.5级说(强调我的意思):
第2.5层平台可以被认为是“可以构建的”,但是没有通过rustup提供的构建
同时,您将需要从源代码构建自己的libcore / libstd。可以使用xargo工具来完成。我没有时间也没有能力去实际测试该编译器是否正常工作,但是像这样的东西是一般的起始路径:
% rustup override set nightly
info: using existing install for 'nightly-x86_64-apple-darwin'
info: override toolchain for '/private/tmp/example' set to 'nightly-x86_64-apple-darwin'
nightly-x86_64-apple-darwin unchanged - rustc 1.41.0-nightly (5c5b8afd8 2019-11-16)
% cat > Xargo.toml
[target.x86_64-apple-ios-macabi.dependencies.std]
# features = ["jemalloc"] # Whatever is appropriate
% xargo build --target x86_64-apple-ios-macabi
# Iterate until libcore and libstd compile and work for your platform
,
@shepmaster 's answer是正确的。详细而言,您必须:
cargo install xargo
项目中的CD
使用附近的版本:
rustup override set nightly
Xargo.toml
文件:[target.x86_64-apple-ios-macabi.dependencies.std]
在您的项目Cargo.toml中,确保[profile.release]
部分包含panic = "abort"
。如果没有,请添加它。
在构建项目时,使用xargo
代替cargo
。
如果您安装了旧的锈迹,则可能需要每晚删除旧的(或至少对我来说每晚更新失败):
rustup toolchain remove nightly
rustup update
rustup toolchain install nightly