================ @@ -1345,7 +1345,16 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, if (AsNeeded) addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false); } - CmdArgs.push_back("-lflang_rt.runtime"); + if (TC.getTriple().isOSAIX()) { + // On AIX, pass the whole path of flang_rt.runtime.a to be consistent + // with clang. + std::string CRTBasename = "libflang_rt.runtime.a"; + SmallString<128> Path(TC.getCompilerRTPath()); + llvm::sys::path::append(Path, CRTBasename); + if (TC.getVFS().exists(Path)) + CmdArgs.push_back(Args.MakeArgString(std::string(Path))); ---------------- Meinersbur wrote:
IMHO just doing nothing if the file does exist is a very confusing behavior. https://github.com/llvm/llvm-project/pull/131041 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits