Re-linking avoidance is too aggressive
I'm constantly annoyed by having to
rm the binary when I want to relink with different options (
-threaded, etc.). We only check the date of the binary against the date of the object files and relink if it is out of date, we should really check whether the options have changed or not too.
Similar problems exist in ordinary
.hs recompilation (see #437 (closed)), but the solutions will be different, so it makes sense to have a separate ticket.
One solution is to store information about what settings were in effect when linking in the binary, perhaps in a special section that isn't loaded during execution. We already compile a C file during linking to support
-rtsopts, so we could add some magic asm to it, and then use
objdump during linking to extract the information from the existing binary if there is one.