3
votes

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 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 think this can be closed, since the rustup show bug has been fixed and the rest seems impossible to reproduce with the current rustup/rustc/cargooli_obk

1 Answers

2
votes

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?