Index: lib/Driver/Driver.cpp =================================================================== --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -994,7 +994,17 @@ } if (C.getArgs().hasArg(options::OPT_print_libgcc_file_name)) { - llvm::outs() << GetFilePath("libgcc.a", TC) << "\n"; + ToolChain::RuntimeLibType RLT = TC.GetRuntimeLibType(C.getArgs()); + std::string Path; + switch (RLT) { + case ToolChain::RLT_CompilerRT: + Path = TC.getCompilerRT(C.getArgs(), "builtins"); + break; + case ToolChain::RLT_Libgcc: + Path = GetFilePath("libgcc.a", TC); + break; + } + llvm::outs() << Path << "\n"; return false; }