I’m not sure if there is a tool out there that does this, so before I go and write it, I figured I should ask:
Often I write an ocaml link-step, e.g.
ocamlc <yadda yadda yadda> a.cmo b.cmo c.cmo -o argle.byte
[or the equivalent for -a
]
and find that the inputs are in a wrong order. And it’s always a bit of a pain to figure out what order is compatible. It seems clear that one can write a tool (I’ve used the binary-manipulation apparatus before to look at deps) to calculate whether a given order is correct, but I haven’t seen a tool that does it. Obviously one can’t reorder inputs to a compatible topological order, b/c there are possible side-effects in the order of linking files. But one could certainly detect that a given order is wrong, and inform the user of which input-pairs were out-of-order.
Is there a tool that does this? I can’t find one. If not, I guess I’m gonna write one.