I think this is how it should work...
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.