[flang] [clang] [flang][windows] Add option to link against specific MSVC CRT (PR #70833)
Brad King via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 1 12:45:11 PDT 2023
================
@@ -976,12 +976,46 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC,
return true;
}
-void tools::addFortranRuntimeLibs(const ToolChain &TC,
+void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) {
if (TC.getTriple().isKnownWindowsMSVCEnvironment()) {
- CmdArgs.push_back("Fortran_main.lib");
- CmdArgs.push_back("FortranRuntime.lib");
- CmdArgs.push_back("FortranDecimal.lib");
+ CmdArgs.push_back(Args.MakeArgString(
+ "/DEFAULTLIB:" + TC.getCompilerRTBasename(Args, "builtins")));
+ unsigned RTOptionID = options::OPT__SLASH_MT;
----------------
bradking wrote:
In local testing, `flang-new -fms-runtime-lib=static foo.f90 -v`, where `foo.f90` is an empty `program` statement, fails with a bunch of unresolved CRT symbols.
https://github.com/llvm/llvm-project/pull/70833
More information about the cfe-commits
mailing list