Unable to override Rustup toolchain for custom build of iOS Toolchain

倾然丶 夕夏残阳落幕 提交于 2019-12-22 10:11:04

问题


I am creating my own toolchain with my build of Rust. I need this to cross compile with iOS architectures. When trying to set the default toolchain or override the current directory's toolchain, I'm getting an error regarding the name of my toolchain. These are the steps I took to create this new toolchain:

  1. Create Rustup Toolchain

    rustup toolchain link ios $HOME/rustc-ios
    
  2. Override current directory toolchain

    rustup override set ios
    
$ rustup show
Default host: x86_64-apple-darwin
error: toolchain 'ios' does not support components
info: caused by: invalid toolchain name: 'ios'

I've tried other names that conform to the toolchain naming conventions, but to of no avail:

$ rustup toolchain link stable-2016-07-19-x86_64-apple-ios $HOME/rustc-ios
error: invalid custom toolchain name: 'stable-2016-07-19-x86_64-apple-ios'

$ rustup toolchain link stable-x86_64-apple-ios $HOME/rustc-ios
error: invalid custom toolchain name: 'stable-x86_64-apple-ios'

$ rustup toolchain link x86_64-apple-ios $HOME/rustc-ios

[Update]

As for approach #2, when I do the cargo build, I still see the compiler linking the Arm libraries from the targets I installed for the rustup toolchain (i.e., that targets I installed for #1 in /Users/test-user/src/test-rust-lib/target/):

rustc src/lib.rs 
--crate-name test-rust-crate
--crate-type staticlib 
-g 
--cfg 
feature=\"no_network\" 
--out-dir /Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug 
--emit=dep-info,link 
--target armv7-apple-ios 
-L dependency=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug 
-L dependency=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps 
--extern serde_json=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libserde_json-55921106e25a0359.rlib 
--extern serde=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libserde-e281201342afb4d4.rlib 
--extern time=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libtime-750bfdd52feafcb7.rlib 
--extern libc=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/liblibc-1f3392fe1afd1313.rlib 
--extern murmur3=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libmurmur3-ab9a44fb20fb9fad.rlib 
--extern quick_error=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libquick_error-729eced693f2612d.rlib 
--extern url=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/liburl-4690728b1e11fab3.rlib

Shouldn't the Arm libraries be pulled from the rustc that I built?


回答1:


I suspect that the behavior you are seeing in rustup show is a bug in rustup related to that specific command. I've filed an issue to look into it.

What happens when you try to do the build with your custom toolchain after configuring it with rustup link and rustup override?



来源:https://stackoverflow.com/questions/38466493/unable-to-override-rustup-toolchain-for-custom-build-of-ios-toolchain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!