Implement the ShaveToolChain::buildLinker() method instead of calling llvm_unreachable.
Lightly tested, but works ok on a few of the sample applications.
Perhaps this should be a default plus a command-line argument, instead of an environment variable?
Doesn't seem right to hardcode this particular version. Using a default for ToolsRoot if MV_TOOLS_DIR isn't set sounds okay, but presumably should be done up above before the loop.
"-O9"? That seems weird, and is not actually a thing.
These (oneleon/bothleons) don't seem to do anything different than "rtems", so I'd remove them
Why are these building up explicit paths, instead of adding the proper -L search paths, and then -lc -lssp etc?
How about if '--sysdir' provides the value, falling back to the environment var, and then a fixed default?
I could see a couple ways around hardcoding a version - if neither --sysroot nor MV_TOOLS_DIR is used, then the path is arbitrary anyway, so doesn't need a versioned subdir. And arguably is sysroot is given, then it could be an already-versioned pathname. Otoh, detecting the version works fine in that case.
For reference, the example sub-Makefile has hardcoded:
This was cargo-cultism. I've no objection to taking it out, but who's to say that their linker doesn't use it for something, as why else would they bother to put it in the examples?