I've started work on adding a new target to rustc. I have gotten it to the point where I have a working stage 1 compiler. Using this rustc, I can create a simple #[no_core] staticlib and it looks great under disassembly. I'm cross compiling because it's more convenient than running stuff on the target. Also since the target's not yet supported, I figure cross compiling is my only hope.
When I try to build the whole shebang using rustbuild / x.py, it fails at "Building stage1 std artifacts". Unfortunately it doesn't offer much detail about the failure beyond "error: Could not compile 'core'". The "process didn't exit successfully" line indicates that it used stage 0 to build core. Without detailed logs I'll guess that the problem must be that my target's not supported by the stage 0 rustc so it must be giving up. BTW I did use "--verbose" but it still didn't offer any detail here.
If the stage 0 rustc supports everything under the sun then maybe this cross-compile bootstrap need is an uncommon one.
I've tried using the now-legacy ./configure / make build but it failed before the stage1 compiler was produced. I can go back to digging into why this fails if it's the more promising route.
Does anyone have any suggestions about how to get past these issues?
First, yes, you should cross compile first to add a new target.
core is pretty demanding, and it's perfectly possible to be able to compile no_core libraries but not core. I don't think it's stage0 problem... Try running x.py with -v option for verbose output?
I guess I can try to strace it to get some hints about what went wrong. There's bound to be helpful output written by rustc or the linker but it's just been redirected. I just hoped there'd be something obvious about what I was doing that was in error.
I don't expect build/bootstrap/debug/rustc to be able to support --target mynewtarget-unknown-linux-musl though so I'm suspecting that when I dig further I'll find an error message regarding the unsupported target.