When linking a Fortran program, we need to add the runtime libraries to
the command line. This is exactly what we do for Linux/Darwin, but the
interface is slightly different (e.g. -libpath instead of -L).
We also remove oldnames and libcmt, since they're not
needed at the moment and they bring in more dependencies.
We also pass /subsystem:console to the linker so it can figure out the
right entry point. This is only needed for MSVC's link.exe. For LLD it
is redundant but doesn't hurt.
Co-authored-by: Markus Mützel <markus.muetzel@gmx.de>
Are those correct for MinGW? Should this be checking for TC.getTriple().isKnownWindowsMSVCEnvironment() instead?