rustc: Topographically sort dependencies

Linkers interpret the left hand arguments as dependeing on the right hand
arguments (in terms of the command line), so this commit ensures this invariant
by topographically sorting rust libraries getting passed through to the command
line.

I'm not sure why we haven't seen this crop up before, but I'm starting to see
this crop up now, and sadly I'm not sure how to add a test for this because
nothing failed before.