This change introduces support for object files in addition to static
and shared libraries which were already supported which requires
changing the type of the argument from boolean to an enum.
I don't know the original rationale of GNU.. but the final result (probably not out of interest of FSF) is that it's a vendor lock of glibc&gcc.
Please implement your crt* in your libc.
OK, that makes sense. I'm not a huge fan of how this set of code looks, but it also seems unfair to require you to extensively refactor it for this.
Any issues with crtbegin/end and where people believe things should be implemented for any given OS is orthogonal to this.
For mingw (Triple.isWindowsGNUEnvironment) the natural extension is .o as well. So maybe check IsITANMSVCWindows instead here?
This looks like it's incorrectly rebased across rL343537; the non-mingw case should be .lib, not .dll - that was corrected in that commit.