If invoking clang-cl, both libcmt (or another lib, depending on the /M[TD](|d) options) and oldnames are passed as dependent libs. If compiling and linking via the clang driver, we used to just pass libcmt when linking; include oldnames consistently there.
Details
Diff Detail
Event Timeline
lgtm
We need to invent spellings for /MD /MT for the GCC-style driver if we want it to be usable in the MSVC environment. I don't think there's a precise translation to the -static-* family of options, unless I'm mistaken.
It seems weird that we're implicitly adding defaultlib options without checking if the user specified nodefaultlib. But given that's already the case, I don't see a big problem with also adding oldnames.lib.
Yeah I don't think there's any good match in existing GCC-style options. I guess the most appropriate in such a case would be to use -nostdlib or something such, and explicitly mention msvcrt.lib and oldnames.lib. (If compiling with the GCC-style driver but linking by invoking (lld-)link directly, that's essentially what one has to do anyway.)
Well we do check for the -nostdlib and -nostartupfiles options - I guess making it react to -nodefaultlibs also could be considered sensible - as an orthogonal change to this one.