I use bitbake / yocto for a custom linux distribution.
Bitbake builds a gcc for my target and an SDK that contains all libraries and that compiler.
Also it provides an environment file which I can source which sets all the paths for me correctly.
One of that environment variables is the $CC variable, which looks like this on my target:
The CC variable is for invoking a C compiler, not for invoking a linker. You can use CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER to set the linker cargo will use for the arm-unknown-linux-gnueabi target. Most other options in .cargo/config.toml and all the profile options in Cargo.toml can be set using similar env vars.