Rustup add target for a custom toolchain

I have built a custom toolchain 'dev' and used ./x.py install, but use rustup add target for 'dev' got an error:

$ rustup target add armebv7r-none-eabi --toolchain dev
error: toolchain 'dev' does not support components: dev is a custom toolchain

What can I do to make it right?
Thanks in advance!

I followed these steps:

  1. ./x.py build
  2. ./x.py build --stage 2
  3. ./x.py install
  4. rustup toolchain link dev 'installation path'
  5. rustup target add armebv7r-none-eabi --toolchain dev
    What else I need to do?

You need to build the target when building the custom toolchain. You can pass --target to x.py. Make sure to also include the host target, otherwise build scripts and proc macros don't work.

Thank you! You are totally right, it works!