How to cross-compile for a custom RISC-V target and its LLVM?

I have a custom RISC-V platform and a corresponding custom LLVM build to directly integrate custom instructions. Until now, I've only run C code on my platform and I want to be able to run Rust code.

It seems possible to add custom target to my Rust installation but every attempt has been unsuccessful. After going through many forum pages and documentation, it's becoming less and less clear to me what needs to be done (simply add a target to the project's Cargo.toml, complteley recompile rustc ...).
Has anyone done this before and have a tutorial/notes describing the various steps?

Thanks in advance.

I took an existing RISCV target out of rustc --print target-list and then used it as base for my own custom hardware target. I then specify my custom target --target riscv64ima-unknown-none-custom.json when using cargo build. I also build core and alloc from scratch with -Z build-std=core,alloc.

I have not had any experience with a custom LLVM build.