[clang] [Driver] Respect CRT flags and -fms-omit-default-lib in MSVC mode (PR #238235)

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 00:34:37 PST 2026


================
@@ -122,8 +122,20 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
 
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles) &&
       !C.getDriver().IsCLMode() && !C.getDriver().IsFlangMode()) {
-    CmdArgs.push_back("-defaultlib:libcmt");
----------------
mstorsjo wrote:

It's unclear to me in which case this code got executed (which previously was hardcoded to `libcmt`), as we did have proper handling of at least the `-MD`/`-MT` etc options above in Clang.cpp. In which cases did either of these codepaths run/have effect?

https://github.com/llvm/llvm-project/pull/238235


More information about the cfe-commits mailing list